How to process requests evenly with RateLimiterQueue?
See original GitHub issueI’m sending requests to a heavily rate-limited service but want them all to get through eventually, so I have a RateLimiterQueue with the default maximum size, wrapping a RateLimiterMySQL which is using the Sequelize backend for MySQL.
The issue is that whilst we have configured the service to have 10 points per hour, only 5 requests are being executed per hour.
I have the limiter set with the following config (as well as database specific config):
{
"duration": 3600,
"points": 10,
"execEvenly": true
}
And the queue wrapping the limiter has no additional configuration. Is this a known issue?
EDIT: use an example from Consume points evenly article. At the time of this edit, execEvenly
option doesn’t work with RateLimiterQueue.
Issue Analytics
- State:
- Created 2 years ago
- Comments:11 (4 by maintainers)
Top Results From Across the Web
Issues · animir/node-rate-limiter-flexible - GitHub
Count and limit requests by key with atomic increments in single process or ... RateLimiterQueue doesn't process requests evenly when execEvenly option ...
Read more >Performance issue with RateLimiterQueue and execEvenly
Performance issue with RateLimiterQueue and execEvenly ... I'm sending requests to a heavily rate-limited service but want them all to get through ...
Read more >Rate-limiting strategies and techniques - Google Cloud
By adding a random offset (jitter) to the time of the initial request or to the delay time, the requests and retries can...
Read more >Optimize your Azure Cosmos DB application using rate limiting
Your application processes an ingestion job that contains 10 K records, ... Instead if you send those requests evenly across 5 seconds, ...
Read more >How to Design a Scalable Rate Limiting Algorithm with Kong API
A rate limiting algorithm helps automate the process. rate limiting enabled at 2 requests/min. In the example chart, you can see how rate ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This is all working perfectly. The code is really simple now:
Thanks once again for the help with this - hopefully this ends up being useful to others with this type of use-case
@sam-lord You’re welcome. It looks nice.
There is a separate issue for
execEvenly
option bug: https://github.com/animir/node-rate-limiter-flexible/issues/113And I created a knowledge base article with slightly changed example: Consume points evenly