Error Budgets
If the SLO says 99.9% of requests must succeed, then 0.1% may fail. That 0.1% is the error budget: an amount of unreliability the team is allowed to spend, on purpose, in exchange for change. Deployments, migrations, experiments and plain bad luck all draw from it.
error budget = (1 − SLO) × valid events in the window
budget remaining = 1 − (bad events so far / error budget)Budgets in requests and in minutes
A request-based SLO gives a budget of failed requests. For intuition people also translate it into "minutes of full outage", which is what the budget would buy if the whole service were down:
WINDOW_DAYS = 28
REQUESTS_PER_DAY = 2_500_000
print(f"{'SLO':>7} {'failed requests allowed':>24} {'full-outage minutes':>20}")
for slo in (0.99, 0.995, 0.999, 0.9995, 0.9999):
budget_fraction = 1 - slo
requests = budget_fraction * REQUESTS_PER_DAY * WINDOW_DAYS
minutes = budget_fraction * WINDOW_DAYS * 24 * 60
print(f"{slo:>7.2%} {requests:>24,.0f} {minutes:>20.1f}") SLO failed requests allowed full-outage minutes
99.00% 700,000 403.2
99.50% 350,000 201.6
99.90% 70,000 40.3
99.95% 35,000 20.2
99.99% 7,000 4.0
A partial outage spends the budget more slowly: 10% of requests failing for an hour uses as much as a full outage for six minutes. That is why request-based budgets are fairer than "uptime minutes" for services with many instances, where most failures are partial.
Spending the budget: a ledger
The model keeps a ledger for one 28-day window. Background errors trickle in every day; three events take bigger bites. The output shows how much budget each one consumed and how much is left:
SLO = 0.999
DAYS = 28
REQUESTS_PER_DAY = 2_500_000
budget = (1 - SLO) * REQUESTS_PER_DAY * DAYS # 70,000 failed requests
events = { # day -> (description, failed requests)
4: ("bad deploy, rolled back after 12 min", 21_000),
11: ("database failover, 3 min of errors", 6_500),
19: ("dependency degraded for 4 h (6% errors)", 26_000),
}
spent = 0
for day in range(1, DAYS + 1):
background = REQUESTS_PER_DAY * 0.0002 # 0.02% everyday noise
spent += background
if day in events:
what, failed = events[day]
spent += failed
print(f"day {day:2}: {what:<42} uses {failed / budget:5.1%} remaining {1 - spent / budget:6.1%}")
print(f"day {DAYS}: background errors used {DAYS * REQUESTS_PER_DAY * 0.0002 / budget:.1%} in total")
print(f"end of window: remaining {1 - spent / budget:.1%} "
f"(SLI {1 - spent / (REQUESTS_PER_DAY * DAYS):.4%} vs SLO {SLO:.1%})")day 4: bad deploy, rolled back after 12 min uses 30.0% remaining 67.1%
day 11: database failover, 3 min of errors uses 9.3% remaining 52.9%
day 19: dependency degraded for 4 h (6% errors) uses 37.1% remaining 10.0%
day 28: background errors used 20.0% in total
end of window: remaining 3.6% (SLI 99.9036% vs SLO 99.9%)
Background noise alone takes a fifth of the budget. That is common: a service whose normal error rate is close to its SLO has no room for change, and every deploy is a gamble. Lowering the background rate (or relaxing a too-strict SLO) is the first reliability project in such a team.
What the budget is for
The budget is not a target to burn and not a punishment. It answers a recurring argument with a number:
| Situation | Without a budget | With a budget |
|---|---|---|
| product wants to ship a risky feature | opinion against opinion | plenty of budget left: ship it, with a canary |
| a flaky dependency keeps causing errors | "it's their fault" | it spends our budget: add a fallback or a cache |
| the budget is exhausted | blame | the policy kicks in: reliability work first (next lesson) |
| a quarter with budget unused | "great quarter!" | maybe the SLO is too loose, or the team is too cautious and ships too slowly |
Budgets for latency SLOs
The same arithmetic works for latency: with "99% of requests under 300 ms", 1% of requests may be slower. Track it as a separate budget. A service can be within its availability budget while its latency budget is gone, for example after a change that made a cache miss more often.
Test yourself
A service serves 1,000,000 valid requests in 28 days with a 99.5% SLO. How many requests may fail?
- 500
- 5,000
- 50,000
- 995,000
10% of requests fail for 60 minutes. How many minutes of full outage does that equal in budget terms?
- 60
- 6
- 0.6
- 10
A team never uses more than 10% of its error budget, quarter after quarter, and ships monthly. What might that suggest?
- Everything is perfect
- The SLO may be too loose or the team too cautious: it could spend more budget on faster change
- The SLI is broken
- They need a stricter SLA