An Interactive Guide To Rate Limiting

Passionate about all areas of computer science, currently exploring DevOps, SRE and Linux
Search for a command to run...

Passionate about all areas of computer science, currently exploring DevOps, SRE and Linux
Great article, I'm following you, I hope I can learn such vivid knowledge similar to this one from your follow-up articles in the future
Dear respected author,Hello, I would like to request permission to reprint one of your articles on my blog (translated into Chinese). I will give full credit to the original source. Is that acceptable? Looking forward to your reply.
I need to add one more thing. I won't make any profit by reprinting your article, and my blog doesn't have any advertising revenue either. I just think the article you wrote is relatively clear.
Sure I will be delighted. Do send me the link to the translated article. Not that I can read Chinese but I would love to see the translation anyways.
I appreciate it. I'll get back to you as soon as possible.
Hello, I have translated the article and published it on my blog. To honor the copyright of the original author, I have placed the copyright notice at the top of the article. I hope this translation provides value to the readers, and I welcome any feedback. URL:log.660066.xyz/2025/06/13/interactive-guide-to-rate-limiting
Thank you for the translation.
Guesstimating the counts when memory is tight

Introduction Word cache originates from French word cacher which means to hide. Outside computer science circle it refers to a secret place where you hide things, usually emergency supplies. In computer science though the meaning of the word is flipp...

Guide to connecting your Nest app with Jagear via OpenTelemetry

A quick guide on partitioning, sharding, and replication

Rate limiting is a must have strategy in every back-end app. It prevent one user from overusing a resource and degrading the quality of service for other users. Here are some benefits of rate limiting
It presents resource starvation
Reduces server hosting cost
Provides basic protection against DDoS
I have made four interactive app that let’s you play around with common rate limiting algorithms.
A bucket holds fixed number tokens
Tokens are added to bucket at fixed rate
When a request comes in:
If a token is available, it’s removed from the bucket and the request is allowed.
If no tokens are available, the request is rejected or delayed.
Allows for occasional short burst if tokens are available
I have created an app that let’s you play with leaky bucket algorithm.
Think of it as a bucket leaking at a fixed rate
Incoming requests are added to the bucket
Requests are processed (or "leak") at a constant rate
If the bucket is full when a new request arrives, the request is dropped
Smooths out bursts; outputs requests at a steady rate
I have made an app that let’s you play with leaky bucket algorithm.
Time is divided into fixed size windows (e.g., 1 minute)
A counter tracks the number of requests per client/IP in the current window
If the count exceeds the limit, further requests are rejected until the next window
Simple and efficient, but allows burst traffic spike at end/start
I have created an app that let’s you play with fixed bucket algorithm.
Keeps a timestamped log of each request
When a request comes in, logs are checked to count how many requests were made in the last X seconds
If under the limit, the request is allowed and logged; otherwise, it’s rejected
I have created an app that let’s you play with sliding bucket algorithm.