Digital Infrastructure

Token Bucket Burst Drain Calculator

When will a full token bucket empty under a sustained burst above its refill rate?

Measured values and planning assumptions
Supported: 0 to 1000000000.
Supported: 0 to 1000000.
Supported: 0.001 to 1000000.
Supported: 0 to 1000000.

Method, formula and assumptions

Net consumption = demand - refill. A full bucket empties after capacity / net consumption seconds. Excess demand during the burst is max(0, net consumption x duration - capacity).

Input definitions and supported units

  • Initial bucket tokens: Measured or assumed numerical value, from 0 to 1000000000; zero is supported where the stated method permits it.
  • Refill rate (tokens/s): Measured or assumed numerical value, from 0 to 1000000; zero is supported where the stated method permits it.
  • Request token demand (tokens/s): Measured or assumed numerical value, from 0.001 to 1000000; must be positive.
  • Burst duration (seconds): Measured or assumed numerical value, from 0 to 1000000; zero is supported where the stated method permits it.

Worked example with answer

100 initial tokens, 10 tokens/s refill and 30 tokens/s demand drain at 20 tokens/s. The bucket empties in 5 seconds; a 10-second burst leaves 100 unserved tokens and 0 tokens remaining.

How to use the results

Unserved tokens represent work that must wait or be rejected under this model. They are requests only when each request costs exactly one token.

Results retain full precision internally and display up to four decimal places. Very small nonzero results use scientific notation rather than appearing as zero. Check the labels before comparing values across units.

Limitations and references

Fluid-rate arithmetic does not simulate individual arrivals, refill quantization or queue policy. Bucket depth alone does not guarantee latency or fairness.

The method is a self-contained arithmetic, geometric or explicitly stated mathematical model. There are no imported tariffs, empirical presets or equipment specifications; measured values and allowances must come from your own process.

Related planning tools

Browse all Digital Infrastructure calculators

Creator & reviewers

Creator persona

Reviewer personas

These names are pseudonymous editorial personas used to organize Northstar's work, not separate verified contributors. Reviewer assignments describe editorial responsibilities, not completed independent reviews or professional credentials. About our editorial personas.