2 ms·
never heard of this before. I looked it up https://en.wikipedia.org/wiki/Token_bucket https://en.wikipedia.org/wiki/Token_bucket I think this would be like a f
by avg_dev 2y ago
never heard of this before. I looked it up https://en.wikipedia.org/wiki/Token_bucket https://en.wikipedia.org/wiki/Token_bucket
I think this would be like a firewall or ingress thing that would drop packets that resulted in excess load before they make it to the application server.
- jart 2y agoHere's the code I use: https://github.com/jart/cosmopolitan/blob/master/net/http/tokenbucket.c https://github.com/jart/cosmopolitan/blob/master/net/http/to...
- sakopov 2y agoIt's a common rate limiting algorithm. Here's an interesting article from Stripe on how they use it in their APIs. [1] [1] https://stripe.com/blog/rate-limiters https://stripe.com/blog/rate-limiters