-
-
Notifications
You must be signed in to change notification settings - Fork 279
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
CPU overload with v3.0.4 #348
Comments
Hi @phstc, It seems that my problem comes from the delay parameter. If I switch delay to 0 in configuration, everything is OK, but if I use a bigger value the problem appear again. I'm testing shoryuken in a blank rails app, with only a default active_job worker. My configuration look like :
I'm using this configuration with a newly created SQS queue. I can put my app on a public repo if you need it. Philippe |
So
So your queue is empty, right? |
Exactly, delay > 0 overloads the CPU and I'm using an empty queue. |
Hi @xymox I couldn't reproduce it. Do I need to keep the app running for a long while? Do you have any wait time configured in the queue? |
I encountered the same problem.
And My configuration is as follows,
I revert back to shoryuken 3.0.3, fix the problem. I check syoryuken master branch source code, and after correcting the source code as below,
|
Experiencing the same issue. This seems to be the pr causing this: #345 Will try the delay zero workaround and otherwise revert to the previous version. |
I just looked at the code and why this causes issues with delay != 0, since it sounded weird and interesting. This is my current theory: After #345 when a queue has a delay and no messages it's being paused most of the time, resulting in the I didn't explore in depth why the old solution worked, but it's probably due to the heartbeat stuff slowing the main loop down with the 0.1 second execution interval? |
Fix #348 When delay is specified, dispatch gets into an endloop (the higher delay, the worse)
Hi all Thanks a lot for these feedbacks, they helped a lot. Interesting enough, if I don't enable logging, my CPU stays around 60% (still high), but if I enable it, it goes easily to 90%. Are you guys using @nishio-dens @jjoos I mixed up your feedbacks and added a delay only when there will be no fetching from SQS (which is a delay in somehow itself you pointed out): https://github.com/phstc/shoryuken/pull/354/files#diff-9fdc6bf30b3f5b4078e1e4d4720765b7R66 WDYT? |
…-avoid-cpu-overload-348 Pause before dispatching to avoid CPU overload Fix #348
Is that for a single core or the whole processor? In my case it takes a complete core without Solution is fine, thanks for the quick fix! |
Hi @jjoos I got 60%-90% in a single core. If you run the latest in production, please let me know how it goes! 🍻 |
@jjoos cool, I see. The spikes were when there were no messages in the queues, right? |
Well I also changed the delay setting back from 0 to 1, besides updating it. So not having major changes in load is fine! The spikes are actual jobs being processed on that machine. I'm not sure why the spikes where higher before the release then after. That's probably unrelated.... |
Hi,
It seems that modifications introduced in v3.0.4 (in lib/shoryuken/manager.rb I suppose) cause CPU overload over 95% on some plateforms (tested on Ubuntu and Mac os x).
Revert back to v3.0.3 fix the problem. I haven't test on master branch but I can do some tests and write steps to reproduce if needed.
Thanks for your attention,
Philippe
The text was updated successfully, but these errors were encountered: