If the rate limiting is set on the worker, would a new deployment reset duration in rate limiting? #2582
-
We are setting the rate limiting on the worker. Lets take the following example:
Assuming from this each 1 second, the worker would consumer 10 jobs.Adding a extra worker, now with 2 workers we should still only take 10 jobs total from the queue every 1 second. Is this right? Or would each worker take 10 jobs/s Given that. If we have a long duration. Lets say for limiting an API for free tier each month.
Would this result in only 10 jobs being processed (in a small burst in the beginning of the month), even if we increase the amount of deployments? Or scale down deployments to 0 for and back to 1? Or would the duration reset. There is some misunderstanding on my side as in where is the worker code is running. Is the worker present on redis? Is it present only within the node application? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
To answer my own question it works. I can set 1 month time and 10 limit, this processes 10 requests each month, with maximum processing 10! The problem others might run into is that there is an upper limit to setTimeout value which will throw warnings once you hit a 30 day mark!
|
Beta Was this translation helpful? Give feedback.
Pls upgrade to v5.12.2