bullmq icon indicating copy to clipboard operation
bullmq copied to clipboard

Balancing Parallel Jobs Across Workers in BullMQ Pro

Open NaCloudAI opened this issue 9 months ago • 1 comments

I am interested in the Pro version of BullMQ, but I don't see any documentation on how to balance parallel jobs across workers. For example, if there are 3 workers, each capable of handling up to 10 jobs, is it possible to ensure a distribution like [3, 3, 4]?

Furthermore, in a more advanced scenario where the performance of our workers in a cluster is uneven (e.g., having an RTX A6000 mixed with an H100 in the system), can we balance parallel jobs based on load percentages? For instance, worker A can handle 30 jobs, while worker B can handle 60 jobs, when there are 45 jobs coming in ,it is preferred to balance them at [15,30]

Additionally, I would like to know if the Pro version is also open-source and can be modified by us.

NaCloudAI avatar May 09 '24 20:05 NaCloudAI

I am interested in the Pro version of BullMQ, but I don't see any documentation on how to balance parallel jobs across workers. For example, if there are 3 workers, each capable of handling up to 10 jobs, is it possible to ensure a distribution like [3, 3, 4]?

You chose the concurrency factor per worker, so you could choose it as you wrote in your example.

Furthermore, in a more advanced scenario where the performance of our workers in a cluster is uneven (e.g., having an RTX A6000 mixed with an H100 in the system), can we balance parallel jobs based on load percentages? For instance, worker A can handle 30 jobs, while worker B can handle 60 jobs, when 45 jobs are coming in, it is preferred to balance them at [15,30]

If the code that instantiates the Worker can somehow get info on the machine it is working on (via an env variable or something like that), then you could easily choose which concurrency factor you want for every worker.

Additionally, I would like to know if the Pro version is also open-source and can be modified by us.

It is for the moment closed source, we may consider providing the source with some special license though, but nothing we have decided yet.

manast avatar May 10 '24 09:05 manast