Burst requests using leaky bucket size
See original GitHub issueIs there any way to implement a leaky bucket algorithm with bucket size in order to allow burst requests?
For example a bucket of size 10 with 2 req/s leak rate allows up to 10 burst requests which fill the bucket and then only 2 req/s while the bucket remains full. If there are no requests, then the bucket empties at the 2 req/s leak rate, allowing another 10 burst requests after 5 seconds.
This is the implementation of the bottleneck
library: https://github.com/SGrondin/bottleneck#increase-interval
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Leaky bucket - Wikipedia
The leaky bucket is an algorithm based on an analogy of how a bucket with a constant leak will overflow if either the...
Read more >API Rate Limits - Getting started with Recharge
“leak rate” refers to the number of requests that will be processed by the server at the same time, while “bucket size” refers...
Read more >What is the leaky bucket algorithm? – TechTarget Definition
Learn about the leaky bucket algorithm to reduce network data congestion by temporarily storing requests and organizing them into set-rate output of packets....
Read more >24 Token Bucket Rate Limiting
It is also possible to use token buckets to describe the router itself; in this setting, the leaky-bucket formulation may be clearer. The...
Read more >Token Bucket - an overview | ScienceDirect Topics
A token bucket provides a mechanism that allows a desired level of burstiness within a flow by limiting its average rate as well...
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
@matomesc Hi. This package doesn’t provide that logic exactly, but there is an option. You can create BurstyRateLimiter and use it with RateLimiterQueue.
This rate limited FIFO queue allows to queue up not more than 10 requests. It executes 2 requests per second and allows traffic burst up to 10 every 5 seconds.
@animir Thanks!
I’m in a hurry to deliver and will not investigate the changes right away but I will come back later to find a solution for the burst also. Best regards!