-
Notifications
You must be signed in to change notification settings - Fork 51
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 usage when idle #132
Comments
Hi @AlexanderPavlenko , Thank you for opening this issue. It is reproducible to an extent (I need more threads before one of them starts to happily spike). Although I'm not sure where the math went wrong, it seems to have been caused by an integer overflow in the wind-down timer value (though there should have been a single zero bit there that would protect us in the test value)... ... However I'm not sure if this was the cause because on my computer I've been getting different results and it was harder to reproduce on a 64 bit system (I'm guessing the issue is more pronounced on 32 bit machines as they would have a single bit left before overflow instead of 33 bits left). Either way, at some point the I pushed a commit with a possible fix. Any change you could test and make sure this solves your issue before I release a patch? Thanks, |
It does, thank you very much! |
Thanks! |
System Information
Description
An idle thread in a Rails 5.2.8.1 app consumes CPU.
Rack App to Reproduce
Not sure if it's reproducible. Maybe it's not Iodine's thread, but
cat /proc/$rails_s_pid/task/*/stack | grep -c nanosleep
seems to always be equal toIodine.threads * 2
.1 worker & 2 threads – no problem. 1 worker & more than 4 threads – problem occurs.
Expected behavior
All threads consume ~0 CPU when idle, strace logs slow
Actual behavior
One of the threads consumes ~15% CPU when idle, strace logs fast
The text was updated successfully, but these errors were encountered: