Performance

Token bucket

Rate limiter that accumulates tokens at a fixed rate.

Main article: Rate limiter simulator


In plain terms

Allows bursts up to the bucket size and holds the long-run rate to the refill rate. Amazon API Gateway and Stripe use it for their API limits.

Origin

Originally ATM cell-rate specification. Generic now: every cloud rate limiter, every CDN, every API gateway implements it.

Where it shows up in production
  • Stripe, GitHub, AWS APIs All use token-bucket variants; bursts allowed up to bucket size, average rate stable.
  • tc (Linux traffic control) TBF queueing discipline shapes outgoing traffic with token bucket semantics.
On Semicolony
Sources & further reading
Found this useful?

Published