ixti / sidekiq-throttled

Concurrency and rate-limit throttling for Sidekiq
MIT License
709 stars 76 forks source link

Throttling not clearing - sidekiq_throttle_as not working properly #119

Closed Blokh closed 1 year ago

Blokh commented 2 years ago

Greetings, sidekiq_throttle_as is not working properly as the jobs that are finishing are not clearing the keys. The concurrency key is always stuck at max ( 20 )

redis.zrange('throttled:feed_listing_worker_concurrency_strategy:concurrency.v2', 0, -1).count => 20 although there are currently 9 running jobs. I've generated a worker to clear up the not running jids. but the issue is that it isn't optimized and not working 100%.

Are there any suggestion of what am I doing wrong?

In 0_sidekiq: Sidekiq::Throttled::Registry.add(:feed_listing_worker_concurrency_strategy, concurrency: { limit: 20 }) # limit all the feed listing workers concurrency combined In the worker:

  include Sidekiq::Throttled::Worker
  sidekiq_throttle_as :feed_listing_worker_concurrency_strategy

Gems versions: sidekiq-throttled (0.15.0) sidekiq-pro (5.0.0) sidekiq (5.2.8)

ixti commented 1 year ago

Can you check against v1.0.0.alpha? I have plans on refactoring the internals of throttling (planning on switching gears to redis-throttle) completely, but before that would like to iron out all the sidekiq integration bugs first.

ixti commented 1 year ago

I'm closing this for now - feeel free to reopen.