Intermediate
Open
Pro
Configuring a Token Bucket for Burst and Sustained Rate
A public API wants: sustained rate of 600 requests/min per API key, with clients allowed to burst up to 40 requests instantly after being idle.
- Give the token bucket parameters (r, B) that satisfy this.
- A client has been idle for 10 minutes, then sends 40 requests in the same millisecond, then continues at a steady 15 requests/s. Walk through what the bucket does for the first 3 seconds of the steady phase (state after each second is enough).
- A different client sends exactly 10 requests/s forever, never bursting. Does it ever get denied? Explain using the bucket math.
Share this question