bullmq icon indicating copy to clipboard operation
bullmq copied to clipboard

Dynamic Rate Limiting

Open SChandel-cmd opened this issue 11 months ago • 1 comments

So for my project I was implementing rate limiters on specific workers, but I wanted the rate limiting to happen in a sort of dynamic way, as in the job which the worker would be doing makes an api call to another service, and depending on the response time of that service, I want to increase/decrease the rate limit, but that would require me to kill the current worker and make a new one. This is also a very high throughput scenario, so that's not an option since killing it would make me possibly lose running jobs and cause discrepancies. But if it was possible to simply change the rate limit of a worker without having to restart it, that would be great. If anyone knows a workaround for this, that would be appreciated too.

SChandel-cmd avatar Jan 18 '25 16:01 SChandel-cmd

There is manual rate limit, but I am not sure this will do what you want: https://docs.bullmq.io/guide/rate-limiting#manual-rate-limit

manast avatar Jan 20 '25 14:01 manast

this feature is currently available https://docs.bullmq.io/guide/queues/global-rate-limit

roggervalf avatar Oct 24 '25 14:10 roggervalf