Latency Budget Calculator
The number you have promised, usually a p95 or p99 target for the whole request.
Application takes the largest share at 60ms, which is where optimisation pays first. Halving anything smaller moves the total less than the measurement noise.
Components in series
- 10%
- 8%
- 30%
- 20%
- 15%
Network floor
Distance costs time that no amount of tuning recovers. Light in fibre travels at about two thirds of its speed in vacuum, and a round trip covers the distance twice.
Percentiles do not add
Two components with a 100ms p99 each do not produce a 200ms p99, because both are rarely slow on the same request. Adding them is conservative, which is what you want when allocating a budget, but it is not a prediction of what you will measure. The measured p99 of the whole is usually lower than the sum and higher than any single part.
You have 200ms end to end. This shows where it goes, what is left, and what distance takes before any code runs.
Latency budget FAQs
What is a latency budget?
An end to end response time target split across the components that consume it. If you have promised 200ms, and the gateway takes 15, the application 60 and the database 40, you know exactly how much is left for anything you add next.
Do component latencies simply add up?
For a request that passes through each component in turn, yes for averages. Not for percentiles. Two components with a 100ms p99 each do not produce a 200ms p99, because both are rarely slow on the same request. Adding percentiles is conservative, which is what you want when allocating a budget, but it is not a prediction of the measured figure.
How much latency does distance cost?
Light in fibre travels at roughly two thirds of its speed in vacuum, about 200km per millisecond, and a round trip covers the distance twice. Sydney to Singapore is around 6,300km, so about 63ms of round trip is unavoidable before any code runs. Real paths are longer than the straight line, so treat the figure as a floor.
Where should I spend optimisation effort?
On the largest component first. Halving something that takes 5ms of a 200ms budget moves the total less than measurement noise, while shaving 20% off the biggest contributor is usually visible immediately.
What if the components exceed the budget?
Three options, in rough order of cost. Run components in parallel rather than in series where the work is independent. Cut the largest contributor, usually with caching or a better query. Or renegotiate the target, which is far cheaper before you have built against it than after.
Is anything sent to a server?
No. The arithmetic runs in your browser and the page works offline.