Calculator Hub

Technology & Computing

API Rate Limiter Token Bucket & Leaky Bucket Sizer

Size a token bucket or leaky bucket rate limiter to sustain an average request rate while tolerating bursts.

Your inputs

Change any value to update the result instantly.

Technology & Computing

Requests admitted immediately

500 requests

Requests queued/throttled

300 requests

Time to drain remaining burst

3 sec

Time to fully serve the burst

8 sec

Increase bucket capacity to tolerate larger bursts without rejecting requests; increase refill rate to raise the sustained long-run throughput.

Formula and working

Bucket fills at refillRate tokens/sec, up to bucketCapacity; a burst of size B drains the bucket in B ÷ refillRate seconds if B > capacity is disallowed

  1. 1

    Collect the inputs

    Sustained allowed rate (requests/sec) = 100; Bucket capacity (max burst size, tokens) = 500; Incoming burst size (requests) = 800

  2. 2

    Apply the formula

    Bucket fills at refillRate tokens/sec, up to bucketCapacity; a burst of size B drains the bucket in B ÷ refillRate seconds if B > capacity is disallowed

  3. 3

    Result

    Requests admitted immediately = 500 requests

Frequently asked questions

Important limitation

This is an educational estimate based only on the values and formula shown. Verify current rates, rules, units, and professional standards before relying on the result. It is not personalized financial or investment advice.

Report a mistake or request an improvement

Tell us if a formula, unit, explanation, or result needs attention. Your message will include this calculator’s name and page.

Related calculators

Back to Calculator Hub