-
Notifications
You must be signed in to change notification settings - Fork 236
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
Advice: Scheduling with intervals #387
Comments
hey @softwaregravy, yes, this seems the right approach, the scheduler will push the jobs to sidekiq and sidekiq will process them. If you're running a single instance of But running a single instance of the scheduler as you're doing should be 💯 |
Thank yo very much for getting back to me so quickly. I will have lots of workers. I also trimmed my Procfile for this, I have a couple of other types of workers as well. We're architected to scale mostly linearly with workers. (meaning, as we scale, we can add workers and we will maintain overall latency.) I'm assuming that a heroku dyno counts as a host in this context. So having 10 worker dynos would count as 10 hosts. This is exactly the scenario I'm trying to correct for. 2 quick followups:
|
Exactly
I was going to mention this before, but yes, it can be a regular worker; I don't see any need to limit it to a single thread
I would suggest testing this approach, if you have success and don't see any problem, a PR improving the readme is more than welcome! We can keep this issue open until then |
Great. I'll plan to check back in early next week (~June 22nd). If everything is smooth, I will see about converting this into the readme. |
Just a note @softwaregravy, keep an eye on #332, I'm working on introducing a different Locking strategy so we can run sidekiq-scheduler in multiple hosts without having to worry about the same job be scheduled by multiple hosts |
@marcelolx Thanks. Your ping reminded me to come back to this. As for the fix in 332, distributed locking is always a hard problem. The setup I used here sort of cheats by relying on Heroku to only give us 1 host, so we delegate the need for single-instance to their infrastructure. Good luck with the more general solution. |
Hi all.
Thank you for the work you put in to this gem. I appreciate it.
I wanted to make sure I had grokked all the docs correctly. I'm was hoping someone very familiar could tell me if I'm approaching this the best way.
Here's an example in my
scheduler.yml
And then I load this from my
config/initializers/sidekiq.rb
And then I set the flag as a scheduler to true in my Procfile, and also reduce the threads to 1.
So then in Heroku, I have the scheduler process, and I just set that to be 1, and I rely on Heroku to keep me with 1 of this process type. The idea being we will have 1 thread running the scheduler across all my dynos.
Does this seem like the right approach? Is there an easier way I should be doing this?
Thank you !
The text was updated successfully, but these errors were encountered: