Two Buckets One Burst

The same arrival pattern is sent through two limiters, both configured for 10 requests per second.

Token bucket: capacity 10 tokens, refilled at 10 tokens per second, one token per request, starts full. A request with no token available is rejected immediately.

Leaky bucket as a queue: a FIFO of depth 10 drained at exactly one request every 100 ms, the first drained at t=0t = 0. An arrival that finds the queue full is rejected.

25 requests arrive in a single instant at t=0t = 0, then nothing.

For each limiter, how many are admitted, how many are rejected, and when does the last admitted request reach the backend?

A

The token bucket admits 20, since the full bucket covers 10 and one second of refill covers 10 more, and the remaining 5 are rejected

B

Both admit 10 and reject 15, but the token bucket forwards all 10 to the backend at t=0t = 0 while the leaky bucket releases one every 100 ms, so its last one arrives at about t=0.9t = 0.9 s

C

The token bucket admits 10 and the leaky bucket admits all 25, because the leaky bucket queues excess arrivals instead of rejecting them

D

Both admit 10 and both hand the backend 10 requests per second, so the two are equivalent and differ only in implementation