Skip to content
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

question: is it expected that throttled jobs run out of order? #122

Closed
josh-m-sharpe opened this issue Jul 4, 2022 · 1 comment
Closed

Comments

@josh-m-sharpe
Copy link

It seems that if I continue to refresh /sidekiq/queues/high - I see a lot of change. And I took a look at the codez and it looks like the gem might work by:

  1. letting sidekiq pluck jobs off the queue normally
  2. re-enqueue them if the job should be throttled

...which would explain why my queue seems so volatile.

Is it possible to avoid this rotation and work the jobs in the order they were enqueued?

Fwiw, I'm throttling multiple jobs with:

Sidekiq::Throttled::Registry.add(:my_throttle,
  :concurrency => {
    :limit => 1
  },
  :threshold => {
    :limit => 5,
    :period => 1.minute
  }
)
 sidekiq_throttle_as :my_throttle
@ixti
Copy link
Owner

ixti commented Jul 4, 2022

Hi. You're right, current version rotates the queue. Throttling happens on per-worker class, not queue. There's no way to overcome this right now. But I have this on my list of things to improve – a way to configure throttling on a per-queue basis.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants