-
Notifications
You must be signed in to change notification settings - Fork 358
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
minutely(5) causes high CPU idle in sidetiq with multiple jobs #208
Comments
Definitely, I overheard vague details about this from @SamSaffron's talk on profiling that I watched a while back. It's been on my peripheral radar to look into it. I'll see if we can add some optimizations for the smaller interval loops. |
Hey guys - so I've been doing some research on this. The issue stems from Now as to why that's an issue in general - when the interval is Sidetiq will keep around the current # from https://github.com/tobiassvn/sidetiq/blob/master/lib/sidetiq/schedule.rb
START_TIME = Sidetiq.config.utc ? Time.utc(2010, 1, 1) : Time.local(2010, 1, 1) So I'm not sure which side of the usage is the problem - that we should be doing something to provide a |
Why can't we just cache the last time in memory, then the first call to get On Tue, Jan 14, 2014 at 1:27 AM, John Crepezzi [email protected]:
|
@SamSaffron This is something that sidetiq has to evaluate pretty often from a serialized copy so they can figure out when the next occurrence is |
@john I follow, but for example. Say you have minutely(5)
On Tue, Jan 14, 2014 at 8:11 AM, John Crepezzi [email protected]:
|
@SamSaffron gotcha now - I think that's similar to the second option in my original comment. It seems a bit odd that sidetiq bases everything off of a fixed start time. They could just as easily update that start time and store it for the next calculation - that would get rid of people's ability to use things like |
@tobiassvn thoughts? |
In 89dee70 I revert the behavior from #92 and add a few more tests - schedule_lock handles the issue mentioned in the ticket, so we can relax I'll leave this sitting for one day to collect any feedback, and then I'll be dropping a release tomorrow with this change thanks! |
I haven't dug deeply into understanding the issue here at an implementation level and how it affects tobiassvn/sidetiq#31, so please forgive my ignorance, but I'm wondering if #203 helps to alleviate any problems here, or if it could. That PR was open for awhile but was just merged a few days ago, so not sure if its changes were considered in context here. |
@seejohnrun That makes sense about Sidetiq's design decision of the fixed Sorry to sort of hijack a closed issue thread for the inquiry here. |
I think that the change made in 89dee70 fixes that issue without need for change on |
Discussion thread (Posts 16-end)
https://github.com/tobiassvn/sidetiq/issues/31
Workaround commit in discourse
Would definitely be nice if this was fixed.
The text was updated successfully, but these errors were encountered: