Open for2gles opened 2 years ago
hi @for2gles, currently this is not possible, you should or use priority or groups. By using priority option, groups will be ignored
Hi @roggervalf, then when do you think is it possible to use both option at once? Actually, I need both at once to use BullMQ Pro. So, it would be nice if there's plan for this. Thank you.
@for2gles could you please share a bit more about your use case so we understand better what you want to achieve?
@manast We are getting data from other system and they have their own rate limit rule by each specific key.
So actually, what we really need is group-key + rate limiter(group-key) + priority(global or group). But as I know, because of some reason, we can't use priority with rate limiter from Bull MQ (link)
So, for alternative, we thought to use group + concurrency(group) + priority + our own rate limiter. So we tried above and found priority seemed not work.
We are getting data from other systems and they have their own rate limit rule for each specific key.
Hmm, how does priority help in this case? wouldn't you need a rate limit that is configurable per group instead?
Ah, there are some data that important and fast response and other that less important and slow response. So normally fast response requests are done. But during processing slow response requests, some time we need to get fast response request first using higher priority.
@for2gles we will study today if it is feasible to implement priorities for groups, I will update this issue later.
Thank you!
@for2gles just to clarify, do you need a priority inside every group, meaning that groups are processed in order but the jobs within the group are prioritized or do you need a global priority, meaning that the groups are picked not in order but based on a priority?
global priority, meaning that the groups are picked not in order but based on a priority
@manast What we need is second option
But anyway after the group picked, it also should processed in order based on a priority
@manast What we need is second option
But in that case, you do not need groups at all. You can just use the global priority from BullMQ, unless I am missing something 🤔
For example, let's say that you have groups with priorities A(p1), B(p2), C(p3), and D(p4), then it would first process all jobs from A, then from B, then from C and finally all from D. So this is the same as just not having groups and using priorities on the jobs.
That's If I run the worker(global concurrency: 1) and each group has only one job. I want to use global concurrency like 500 and group concurrency as 1.
For example1 A(p1, p2, p2, p3), B(p2, p3), C(p3), and D(p3, p4) and global concurrency: 4, group concurrency 1
It should process
For example 2 A(p1, p2, p2, p3), B(p2, p3), C(p3), and D(p3, p4) and global concurrency: 2, group concurrency 1
It should process
Those examples were quite useful, thank you. The case of having only intra-group priority is much more simple to implement than having also an inter-group priority. So we could do the former, but adding inter-group is more challenging so we need to discuss it. Without inter-group your examples would look like this: Example 1:
Example 2:
Oh thank you. It will really useful for me The Best for us is the example2 that I wrote above but what you wrote also very useful!
Hi, This feature would be very useful for me too. Do you have some approximate date when this feature would be accessible ?
Hi @manast. Can you let me know is any progress about it?
We have started an implementation but it is quite complex, so we are working on other smaller issues the reminder of this year. We will pick up again this feature if you are still interested in the beginning of the next year.
Hi, we are still really interested in this feature. I hope Taskforce also interested in :)
@manast Hi there :) Just want to know can you start to implement this feature 🙂 We will really get help from this. BTW, We already started to use the BullMQ Pro 2 weeks ago. Thanks
It is the next feature coming to the Pro version, but it is a bit involved so it is taking more time than I expected.
Hi guys, be aware that we are actively working on local group priorities
Hey, did this ever get implemented?
hi @vlrevolution, intra groups priority was implemented https://docs.bullmq.io/bullmq-pro/groups/prioritized some time ago
hi @vlrevolution, intra groups priority was implemented https://docs.bullmq.io/bullmq-pro/groups/prioritized some time ago
Amazing, I'm using them, thank you!
I'm currently using 2.4.14 version of BullMQ Pro.
And I want to use group concurrency with job's priority.
If I try like below
Code
But if then, creating job logic ignore the group option, and it makes to use full of concurrency