Discussion about this post

User's avatar
Yash's avatar

Nice post!!

Should the leaky bucket implementation should have timer-interrupt based implementation to leak the requests to be processed accurately? In current implementation it leaks at every new request, if the time gap b/w requests is huge that would lead to starvation of requests to be processed.

Roman Voloboev's avatar

Hey. Good visuals.

There is a common misunderstanding about Fixed Window algorithm.

It isn't necessary to connect window boundaries to calendar intervals. Fixed Window doesn't start at 01:30 and ends at 01:31. It starts when the first request arrives and lasts for 1 minute. So it is impossible to send all requests in the end of time frame and then all requests at the beginning of next time frame. The problem is not that bad as it seems.

On the countrary, in almost every article, authors write that there is boundary problem, like x2 traffic bursts. The same people say that Token Bucket is good because it allows traffic bursts. So why traffic bursts is bad for Fixed Window and good for Token Bucket? Do you find it contradictive? I do.

Read more on Fixed Window algorithm here

https://github.com/animir/node-rate-limiter-flexible/wiki/Fixed-Window-rate-limiting-algorithm-explained

2 more comments...

No posts

Ready for more?