Rate limiter playground
Fire bursts at a token bucket, a fixed window and a sliding window, and see which requests get a 429.
admitted · 429 · token
admitted · 429 · busiest 10 s · dashed lines: window boundaries · time 0 → 60 s
The fixed window admitted 40 requests in one 10 s span with L = 20: two windows' quotas meet at the boundary (up to 2×).
How it's calculated · assumptions
r = L ÷ W = 2/s · most admitted in any W: sliding log ≤ L = 20, token bucket ≤ B + r·W = 30, fixed window ≤ 2L = 40
The sliding log is exact but stores a timestamp per request; the token bucket allows bursts up to B and averages r, which is why it's the default. Answer the rest with 429 + Retry-After.
Dots: requests (green admitted, red 429) · amber: tokens · in the windows, the fill is the count against L · quiet stretches play 8× faster (⏩).
Simulated in your browser: one client, one limiter instance (with many gateway replicas, keep counters in Redis). W = 10 s, the bucket starts full, the sliding log keeps admitted timestamps only; streams are seeded, so they repeat. Rules from the rate limiting concept; 429 is defined in RFC 6585.