Rate limiter simulator

The same traffic, five algorithms. Pick one, send a burst, and watch which requests get a 429 and why.

The bucket holds up to the limit in tokens and refills at limit ÷ window per second. Each request spends one token. Bursts up to the bucket size pass at once, then traffic is held to the refill rate.

Limit: 5 requests
Per window of: 2 s
Background traffic
AllowedRejected (429): 0.0 / 55010 s agonow

0 allowed

0 rejected

0% refused since reset

How the five rate limiting algorithms differ

Every algorithm here enforces the same limit, a number of requests per window, but they disagree about bursts. The simulator runs each one on a live 10 second timeline, with the limiter's own state plotted underneath, so you can see the moment and the reason a request is refused.

  • Token bucket: lets a burst up to the bucket size through, then holds traffic to the refill rate.
  • Leaky bucket: queues requests and drains them at a constant rate, so output is perfectly smooth.
  • Fixed window: one counter per window; a client can send twice the limit across a window boundary.
  • Sliding log: exact, with no boundary burst, at the cost of one stored timestamp per request.
  • Sliding window counter: two counters weighted by overlap, close to exact at fixed-window cost.

Lesson: rate limiting concepts · Design a rate limiter: solution and walkthrough · More free tools