‹ All demos
LiveSystem design · APIs

Rate limiter

Watch a token bucket let requests in or turn them away. Change the limits and see what gets through.

How it works

  1. 1A token bucket holds a fixed number of tokens. Each request spends one. Tokens refill at a steady rate.
  2. 2If the bucket is empty, the request is rejected with 429 Too Many Requests. That keeps one noisy client from using up the whole server.
  3. 3The bucket size decides how big a burst you allow. The refill rate decides the long-run average.

Read the post: How to build an API for 100,000 requests a second