Refill at rate; capacity = burst.
The same request pattern fed into Token Bucket, Leaky Bucket, Sliding Window, and GCRA — running locally in your browser. GCRA is the one Stripe / Cloudflare / Discord actually use; this shows why.
One traffic generator at the top emits a deterministic stream of requests. Every algorithm sees the identical stream — they just disagree on what to do with it. Token Bucket and GCRA admit the same total when traffic stays within burst credits; Leaky Bucket smooths into a steady output; Sliding Window admits in groups bounded by its window edge.
On a steady pattern, all four look identical. The differences only emerge when traffic gets bursty — that's why it's an interesting comparison.
1. Token Bucket and GCRA admit one per spike; Leaky Bucket gradually drains; Sliding Window's denial bars cluster at window edges.tat-now — that's the entire state for GCRA, one number.Refill at rate; capacity = burst.
Queue drains at rate; reject when full.
Per-request timestamps inside last window.
Single TAT + math. O(1) state per key.
→ Drag BURST to 1 with Spike pattern to see the difference clearly: Token Bucket and GCRA admit a single request and reject the rest of each spike; Leaky Bucket smooths but still drops. Sliding Window's denials cluster at window edges.