-
Notifications
You must be signed in to change notification settings - Fork 68
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Machida in examples/python/celsius-kafka is idle at 100% cpu time #1584
Comments
I believe that would be because the other examples are tcp which is push vs kafka which is a pull mechanism. I don't think this is a machida issue, I believe we need a new tag for @dipinhora thoughts? |
The cpu usage is definitely because of the There is likely room for improvement on the |
@dipinhora can you open any relevant issues on the kafka-client and here, create any labels to track as needed, add to projects as needed and then we can close this issue out in favor of the newly created issues? |
@SeanTAllen WallarooLabs/pony-kafka/issues/41 created for the idle polling optimization on the pony-kafka side of things. I still feel there's the additional angle of the |
What angle is that @dipinhora? I'm not sure what having 1 thread has to do with it. Other than all polling will stay on a single cpu. And what there would be to address with that. |
@SeanTAllen It seems I wasn't clear. The 100% cpu issue in this ticket has nothing to do with The place where |
@dipinhora i'm not sure what the correct way to interpret that is. I think there is a lot of context and assumptions you are making that I'm not sure of so any answer I give might lead you astray. Are you saying we should be locking and unlocking the GIL so that none python code in machida can run at the same time as the python interpreter? |
@SeanTAllen I'm not familiar enough with Python internals, nor the vagaries of embedded python to make any meaningful statements regarding what should or shouldn't happen with the GIL in machida as related to the embedded python interpreter. I'm ignoring the python related implications in the following statement:
The above statement is based on the following logic/context:
Hopefully the above helps clarify my thought process and any context that I may have previously left out in regards to my statement that |
@slfritchie I just ran Can you confirm which OS you encountered the 100% cpu usage on? |
@dipinhora OS X Sierra (10.12.6) plus XCode 9.0. |
Thanks. I'll try and reproduce on my older version of OS X. |
@dipinhora the OSX idling issue was at least partially address a couple months back on mainline pony. |
@dipinhora re: more than 1 thread. we can do some work with that but in the end python is basically single threaded. we can only ever execute one thread of python code at a time. it will be inherently slower because of that given that we will need to distribute work to other processes. Anyway, that is off topic for this issue. |
@SeanTAllen Re: the OSX idling issue, if you're referring to ponylang/ponyc#1787, I don't believe it's been resolved in mainline pony. |
@SeanTAllen Re: more than 1 thread, I'll open a separate issue because it seems we're currently limiting all of machida to a single thread because of our use of python even though the core of wallaroo that machida relies on is mostly pony actors which can run concurrently (see the Kafka broker connections scenario described earlier as one example of such a scenario). Yes, it will inherently be slower than pony versions of the same program but right now it is slower than it needs to be due to the single threaded execution of everything when only the python bits need to be single threaded. This is not to say it would be easy or possible to run machida with multiple threads while the embedded python is limited to being single threaded. |
@dipinhora re: threads, @aturley and i have had several conversations on that. |
FWIW, the pure pony version uses 2 CPU cores at idle.
|
I believe that is an OSX only issue that was partially addressed (but not fully) in mainline Ponyc. |
@slfritchie Did @SeanTAllen's ponyc fix for OSX busy polling (ponylang/ponyc#2254) resolve this for you? |
Yes. Well, mostly. The idle time of |
I'm looking at the
release
branch at commit de92121, both with & without resilience enabled(*) on OS X. When I see runmachida
process as described by theexamples/python/celsius-kafka/README.md
example while idle (both thetest-in
andtest-out
topics are empty), themachida
process consumes an entire CPU core. Other examples in that directory & at that commit don't have the same behavior, though I've only checked the word count example at the same commit.(*) I once thought that resilience=on vs. off made a difference. It does not, AFAICT.
The text was updated successfully, but these errors were encountered: