Token bucket
A rate limit where each user has a bucket that slowly refills. Each request takes a token, so short bursts pass and steady floods don't.
See it in action
These lessons put token bucket to work. Read one, then play it and watch what happens without it.
- Shape the data and the API: You're building a shop. With bots included, 9,000 req/s arrive, far more than your two servers can answer. Before the…
- The PDF that ate the quota: Your app answers questions about documents: 2,000 req/s, and 1 in 200 asks the model something, 10 calls a second.…
- Let real users burst: A team dashboard: 3,000 req/s, well under your gateway's limit. But opening the dashboard fires 30 calls at once, and…