What a latency budget is
A latency budget is the time a request may take, end to end, before it's too slow to matter: a page that feels instant, an API call inside its caller's own timeout. Every hop the request makes spends part of it. Adding the hops up shows which one spends the most, and whether the rest have room to absorb a bad day.
Why the p99 line matters more than the typical one
The typical total (the p50s added up) is what you see when you test it yourself. Users who hit a slow hop see something closer to the slow-day line. A path with many hops almost always has one of them slow, so the slow-day total is a better guide to what your slowest users feel. Adding p99s together is pessimistic: it's the bound, not the percentile.
Timeouts longer than the budget
If one attempt at a hop can wait longer than your whole budget, the user is gone before your code gives up. A timeout should be shorter than what's left of the budget when the call starts, so the caller still has time to try something else or fail fast.
How retries multiply
A retry is cheap for one request and expensive for all of them. When a service calls another, and each one retries the one below it, the attempts multiply down the chain. Three retries at the app and three at the database means up to 16 database attempts for one user click, all landing on the database exactly when it is struggling. That's a retry storm. The "Retry storm" number above is that product for your path.
How to win the budget back
- Retry at one layer, not every layer. Let the layer closest to the user decide.
- Back off with jitter, and cap retries with a retry budget so a failing dependency sees less load, not more.
- Set timeouts from the budget: the remaining budget, passed down as a deadline.
- Cut hops: reuse connections (no new TLS handshake), cache DNS, serve from the edge.