Ever wonder why some requests get through and others get blocked? This simulator shows you exactly how Token Bucket, Leaky Bucket, and other rate-limiting algorithms work under the hood. Play with different traffic patterns and watch the requests flow (or get blocked) in real-time.
Why play with a rate limiter simulator?
Because reading about Token Bucket vs Leaky Bucket is one thing—actually seeing them handle a burst of traffic is another. This thing saved me hours of trial-and-error when I was picking an algorithm for our API gateway.
What you can try
Five different algorithms to play with: Token Bucket (lets bursts through), Leaky Bucket (smooths everything out), Fixed Window (simple but has quirks at window boundaries), Sliding Window (more accurate), and GCRA (what Stripe uses). Flip between them and you'll immediately see why they behave differently.
The visualization
Green dots = requests that got through. Red dots = blocked. The chart shows internal state over time—token counts, queue depth, whatever's relevant for each algorithm. Helps you understand why request #47 got blocked while #48 made it.
Good for
- Test rate limiter configurations before deploying to production
- Understand algorithm behavior under different traffic patterns
- Educate team members on rate-limiting concepts
- Compare algorithm performance for your specific use case
Questions people ask
So which algorithm should I actually use?
Depends on your traffic. Token Bucket is friendly to bursts (good for APIs with spiky traffic). Leaky Bucket smooths everything out (better for downstream services that hate spikes). Sliding Window is what most people should use—it's accurate without the weird edge cases of Fixed Window. GCRA is fancy but worth it if you need precision.
Does this match production rate limiters?
The algorithms are real—Token Bucket is what Redis and many API gateways use, GCRA is Stripe's approach. The simulation runs client-side so you can test freely without hitting actual limits.
Can I trust the results?
For understanding behavior, absolutely. The implementations match the papers. For production capacity planning, you'll still want to benchmark your specific setup.