Search code examples
ruby-on-railsconcurrencysidekiq

How to specific concurrency for sidekiq queue?


For example I have concurrency with value 4 in sidekiq config with 3 queues: high, default, low.

I start 10 ffmpeg Active Job Workers in low queue long , and 4 of it running , after it next 4 and etc, so everything is fine.But in the same time i want to run another lightweight jobs like making screenshots in a other queue(high). So high queue is not running , it waits untill first of running 4-x jobs finished , but i don't want to wait , I want to run lightweight queue immideatly, how to do it?(in background in queue of'course)


Solution

  • Take a look at the sidekiq-limit_fetch Gem.

    It gives you more control over priority of queues and can limit the concurrency of each queue so that there is more concurrency open to all tasks yet you will be able to limit the ffmpeg jobs to 4.