bull icon indicating copy to clipboard operation
bull copied to clipboard

Cannot dynamically increase concurrency of a queue

Open anurag-rai opened this issue 6 years ago • 5 comments

Description

Suppose a queue is declared as queue.process(concurrency, foo) with some concurrency.

If there are additionally more jobs to process later on, and I have to increase the concurrency of my queue, I need to restart my application and re-initialise my queue with the new concurrency.

  1. I could not find anything in the doc as to how to do this dynamically, so is there any API or any way that can dynamically increase the concurrency of the queue without having to restart the application?

  2. If I redefine the process with queue.process(new_concurrency, foo), are there any repercussions to the jobs that are currently running in this queue? Or is this the way I can increase the concurrency dynamically?

  3. Any API to get the current concurrency of a queue? WIP or future plans or against Bulls ideology?

Bull version

bull: "^3.3.7"

anurag-rai avatar Jan 21 '19 07:01 anurag-rai

I would second this. My use-case is IO-bound, so much simpler if there was a way to update the concurrency vs spinning up new processes.

Bellk17 avatar Apr 01 '20 07:04 Bellk17

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Jul 12 '21 18:07 stale[bot]

I will leave this one as an enhancement, it would be a new method to change the concurrency setting of a queue.

manast avatar Jul 13 '21 16:07 manast

related https://github.com/OptimalBits/bull/issues/290 much needed improvement.

G1K avatar Feb 21 '22 09:02 G1K

Why not just start the queue with the highest concurrency setting you would like? I do not see the point in having less concurrency than the max you want to have. Maybe there is something I am missing.

manast avatar Feb 21 '22 09:02 manast

I will leave this one as an enhancement, it would be a new method to change the concurrency setting of a queue.

Has this been implemented?

aishadeshmukh avatar Nov 15 '22 10:11 aishadeshmukh

It is implemented in BullMQ https://api.docs.bullmq.io/classes/Worker.html#concurrency No plans ATM to backport it.

manast avatar Nov 15 '22 11:11 manast