Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request] Worker Rate Limit without Duration #909

Closed
lukepolo opened this issue Dec 1, 2021 · 7 comments
Closed

[Feature Request] Worker Rate Limit without Duration #909

lukepolo opened this issue Dec 1, 2021 · 7 comments

Comments

@lukepolo
Copy link
Contributor

lukepolo commented Dec 1, 2021

It would be nice to be able to rate limit without a duration for a group

For example:
A job that downloads something from a remote machine as fast as possible but only have 5 concurrent downloads available.

Currently we are using redis to keep track of the number of jobs currently running and then delay them if there's 5 already running.

Im sure theres a better way , and open to ideas

@manast
Copy link
Contributor

manast commented Dec 2, 2021

Ok, so more like a global concurrency parameter instead of the current per worker concurrency right?

@lukepolo
Copy link
Contributor Author

lukepolo commented Dec 2, 2021

Yup!

@manast
Copy link
Contributor

manast commented Dec 2, 2021

Note for future implementer: the challenge here is not so much limiting the amount of active jobs at any given time, but how to "wake" the workers that will be sleeping while the limit has been reached. We want the workers to wake up as soon as they are needed and in a robust way so that they "always" start working as soon as the active number goes below the threshold. Events could be used but the biggest drawback is that events will be sent to all sleeping workers, if there is a large pool of workers this will imply that the workers will all try to start processing new jobs but maybe only a handful will succeed, creating unnecessary stress on Redis.

@xiaosha007
Copy link

A global concurrency feature would be useful for me as well

@nemphys
Copy link

nemphys commented Dec 4, 2021

+1 on this one, super useful if implemented.

@hicaro
Copy link

hicaro commented Dec 7, 2021

+1 on this. I agree this would be extremely useful

@manast
Copy link
Contributor

manast commented Aug 1, 2022

Closing this issue as this has been already implemented for a while: https://docs.bullmq.io/bullmq-pro/groups/concurrency

@manast manast closed this as completed Aug 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants