Sub topic 3
Turning nines into a downtime budget
This chapter assumes you know what availability and the nines notation mean from the earlier chapters. It also assumes you are comfortable with percentages and with reading short Python snippets. Here you will turn a target like 99.9% into concrete amounts of allowed downtime, and see how to spend that allowance.
The core formula
An availability target says what fraction of a period the service must work. The rest of the period is the downtime budget:
downtime budget = (1 - availability) x length of periodThe budget is a ceiling. At 99.9% over 30 days, you may be down for at most 43.2 minutes in total. Several short outages and one long outage draw from the same pool.
The following function computes this. Each added nine removes one digit from the unavailable fraction, so the budget shrinks by a factor of ten.
def downtime_budget_minutes(availability, period_days=30):
return (1 - availability) * period_days * 24 * 60
for target in (0.99, 0.999, 0.9999, 0.99999):
print(f"{target:.3%}: {downtime_budget_minutes(target):.2f} min per 30 days")
# 99.000%: 432.00 min per 30 days
# 99.900%: 43.20 min per 30 days
# 99.990%: 4.32 min per 30 days
# 99.999%: 0.43 min per 30 daysA reference table
Budgets depend on the window you pick. The table uses a 7-day week, a 30-day month, and a 365-day year.
| Availability | Per day | Per week | Per 30 days | Per year |
|---|---|---|---|---|
| 99% | 14.4 min | 1.68 hours | 7.2 hours | 3.65 days |
| 99.9% | 86.4 s | 10.08 min | 43.2 min | 8.76 hours |
| 99.95% | 43.2 s | 5.04 min | 21.6 min | 4.38 hours |
| 99.99% | 8.64 s | 1.01 min | 4.32 min | 52.56 min |
| 99.999% | 0.86 s | 6.05 s | 25.9 s | 5.26 min |
Two habits make these numbers easier to remember:
- 99.9% is about 43 minutes a month and about 9 hours a year.
- 99.99% is about 4 minutes a month and about 1 hour a year.
From those two you can derive the others by shifting the decimal point.
Choosing the window
The same target gives very different practical limits depending on the window. A service that promises 99.9% per year could take one 8-hour outage and still comply, as long as nothing else breaks all year. A service that promises 99.9% per 30 days cannot do that. One 8-hour outage uses up the monthly budget about 11 times over.
Shorter windows are stricter about how bad any single incident can be. Longer windows are more forgiving about when incidents land. Three choices come up in practice:
- Calendar windows reset on a fixed date, such as the first of the month. They are simple to report, but the budget resets suddenly. A team that has burned its budget on the 28th gets a fresh one on the 1st.
- Rolling windows always look at the most recent N days, usually 28 or 30. They have no reset cliff, so an old incident fades out gradually. Most engineering teams prefer them for day-to-day decisions.
- Contract windows are whatever the customer agreement says. They are usually monthly or quarterly.
Months vary from 28 to 31 days, and years from 365 to 366. Pick a convention, such as 30 days, and apply it consistently. A budget that quietly changes length from month to month is hard to track.
Working backwards from a downtime limit
Sometimes you start from what the business can tolerate and need the target. Invert the formula:
def required_availability(max_downtime_minutes, period_days=30):
return 1 - max_downtime_minutes / (period_days * 24 * 60)
print(f"{required_availability(10):.4%}") # 99.9769%
print(f"{required_availability(43.2):.4%}") # 99.9000%A limit of 10 minutes per 30 days needs about 99.977%. That is not a round number of nines, and it does not need to be. Round targets are a convenience. You can set the target to whatever value matches the real tolerance.
Spending the budget
A budget is only useful if you account for what draws it down. Consider a service with a 99.9% target over 30 days, which gives 43.2 minutes. A plausible month looks like this:
- Eight deployments each cause about 2 minutes of degraded service during rollout. That is 16 minutes.
- One database failover takes 9 minutes.
- One bad configuration push causes a 16-minute outage before it is rolled back.
The total is 41 minutes. That leaves 2.2 minutes, and the month is not over. This is why budgets matter more than the headline percentage. They show that routine, expected events consume most of the allowance before any serious incident happens.
Planned work counts only if your definition of "down" counts it. The chapter on planned maintenance and partial outages covers that decision. Here, assume that anything users experience as failure is charged to the budget.
Budgets and response time
Small budgets constrain how you operate, not just how you build. Compare the budget with the time it takes a human to respond:
- At 99.9%, 43.2 minutes per month can absorb one incident that a person detects, diagnoses, and fixes. It cannot absorb many.
- At 99.99%, the 4.32-minute budget is shorter than a typical sequence of alert, acknowledgement, login, diagnosis, and fix. A single human-handled incident can consume the whole month.
- At 99.999%, the budget is about 26 seconds. No human is in the loop at that timescale. Detection and recovery must be automatic, such as health checks that remove a failed node and traffic that shifts without anyone acting.
This is a first look at a theme developed later with MTTR. Past about three nines, the question changes from "how do we prevent failure" to "how fast does the system recover without help".
Edge cases and common mistakes
- Mixing up 99.9% and 99.99%. They look similar, but the budgets differ tenfold. When reading a target, count the nines instead of eyeballing the digits.
- Rounding too early. At five nines, the monthly budget is 25.9 seconds. If your monitoring samples once a minute, it cannot resolve that. Measurement granularity must be much finer than the budget.
- Adding budgets from different windows. A 99.9% annual target and a 99.9% monthly target are different promises. Do not sum or compare budgets without converting to the same window.
- Treating the target as a goal to reach exactly. A budget is a limit and also a resource. Finishing the month with nearly all of it unspent can mean the service is more reliable than it needs to be, and you could have shipped faster or taken more risk.
- Ignoring the base period for percentages of time versus requests. The arithmetic above assumes time-based measurement. Request-based measurement uses the same idea with failed requests in place of minutes, and the next chapter covers it.
Putting it together
When someone proposes an availability target, run through these steps:
- Pick the window and write it down.
- Compute the downtime budget for that window.
- List the routine events that will consume it, such as deployments, failovers, and certificate renewals.
- Compare the remaining budget with how long a typical incident takes to detect and fix.
- If the remaining budget is smaller than a typical incident, either relax the target or invest in automatic recovery.
Exercise
A service has a 99.95% availability target measured over a rolling 30-day window. (a) How many minutes of downtime does it allow? (b) Recent incidents total 12 minutes. How many minutes remain? (c) A typical incident for this service takes 15 minutes to resolve. Can the service afford another one?
Show answer
(a) The unavailable fraction is 1 - 0.9995 = 0.0005. Multiply by 30 x 24 x 60 = 43,200 minutes to get 21.6 minutes. (b) 21.6 - 12 = 9.6 minutes remain. (c) No. A 15-minute incident would exceed the remaining 9.6 minutes by 5.4 minutes, and the service would miss its target unless the older incidents roll out of the window first.
Exercise
A team can tolerate at most 5 minutes of downtime per 30 days. What availability target does that correspond to, and how does it compare with 99.99%?
Show answer
Required availability is 1 - 5 / 43,200 = 0.99988426, which is about 99.988%. That is slightly less strict than 99.99%, whose budget is 4.32 minutes. The team could adopt 99.99% as a round target, but 99.988% matches the stated tolerance exactly.