Tokens Available8.00 / 8
Refill Rate1.5/s
Allowed0
Rejected0
bucket
max: 8
● full
Bucket Level
8.00 tokens available
// events
No requests yet.

// how it works

  • Bucket starts full with maxTokens
  • Each request consumes 1 token
  • Tokens refill at a constant rate: elapsed × refillRate
  • Refilled tokens capped at bucket capacity
  • If tokens < 1 → reject the request

// trade-offs

  • Allows controlled bursting up to bucket capacity
  • Smooth rate limiting over time
  • O(1) time and space
  • Burst at start (bucket starts full)
  • Refill rate tuning can be tricky