Token Bucket Rate Limit Calculator
Set a refill rate and burst capacity, then estimate sustainable request throughput and admission during a constant traffic interval.
The model assumes one token bucket that starts full. Maintained by Buildopsy · Updated .
Rate-limit scenario
Token costs let you model weighted requests; set one token per request for a basic limiter.
Formula and assumptions
Sustainable requests/s = refill tokens/s ÷ tokens per request. Initially available burst requests are bucket capacity ÷ token cost. Over an interval, the estimate admits the lesser of offered requests and (initial capacity + refilled tokens) ÷ token cost.
This fluid approximation assumes a full starting bucket, constant request and refill rates, and one shared bucket. It does not simulate integer token timing, concurrent races, distributed coordination, key-level quotas, or idle-time refill caps. A production implementation should be load-tested at burst boundaries and across limiter replicas.
Frequently asked questions
How many requests per second can a token bucket sustain?
Refill tokens per second divided by tokens charged to each request. Capacity controls how much temporary traffic can pass above the steady rate.
Why do distributed limiters differ from this estimate?
They may share state asynchronously, partition quotas, or experience clock and network effects. This page models a single ideal bucket, not a distributed implementation.
Related calculators
All engineering calculators · Edge request cost · Queue backlog and drain time · Kubernetes HPA replicas

