Limit number of threads per sidekiq queue

落爺英雄遲暮 提交于 2019-12-10 11:40:53

问题


Is there a way for me to limit the number of maximum threads per sidekiq queue?

For example:

We have a daily job that takes quite a lot of time to get processed. On the one hand we can say let's put 20 threads and get it done faster. Well, no - that clogs up our database.

What I want is to have something similar to: DailyJobsQueue - 10 threads max, regularJobsQueue - no limit of threads (the rest of available threads - not to say they will be used not in peak times).

I've seen I can give priority to threads that changes the polling for jobs.. But that's not what I need.

Any ideas?


回答1:


Sidekiq does not allow you to limit concurrency.

I would put the daily jobs in a low priority queue. Normal work will still get processed quickly and the daily jobs will be processed by any leftover threads.



来源:https://stackoverflow.com/questions/27537799/limit-number-of-threads-per-sidekiq-queue

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!