-
Notifications
You must be signed in to change notification settings - Fork 78
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
Allow throttle queues #146
Comments
Can you give an example of throttling a queue by a shared key? The docs only seem to mention a My scenario: I have multiple job classes that run on the |
@joevandyk below is what we're doing right now for throttling multiple jobs with a shared key (not necessarily throttling the entire queue, but if only jobs that have this throttle are put in the queue, then the queue is essentially throttled) in a Rails initializer file, # For Users::Engagement::SetSendsJob, SetOpensJob, and SetClicksJob
Sidekiq::Throttled::Registry.add(:users_engagement_set_etl,
# Only allow 1 job per tenant at a time, for up to 20 tenants at at time
concurrency: [
{ limit: 1, key_suffix: ->(args) { args['tenant'] } },
{ limit: 20 },
]) Then, in the individual jobs, we add sidekiq_throttle_as :users_engagement_set_etl |
I am testing the usage of this as a migration path from sidekiq-limit_fetch having concurrently limited jobs in different queues causes an unexpected effect: if all jobs enqueued in the this is because how the sidekiq queues work https://github.com/sidekiq/sidekiq/wiki/Advanced-Options#queues , but need to be considered for queue-based throttling |
Oh that's interesting @jcsrb. We strictly use weighted queues so we've not run into that |
It's possible to throttle queue by using shared throttling key, but that causes jobs to be pushed back to the end of the queue. It would be nice to have real queue throttling, where job would have been pushed back to the head of the queue, and queue have been paused from fetching for some time.
See: #122
The text was updated successfully, but these errors were encountered: