Sub topic 2
MTBF, MTTR, and Why Recovery Speed Matters
Assume you know basic client-server architecture, percentages, simple probability multiplication, and short Python programs. This chapter connects operational metrics to service objectives.
MTBF, MTTR, and Why Recovery Speed Matters
Mean time between failures (MTBF) is the average operating time between failures. Mean time to repair (MTTR) is the average time needed to restore service after a failure.
For a repairable system:
\[ \text{Availability} = \frac{\text{MTBF}}{\text{MTBF} + \text{MTTR}} \]
A service can improve availability by failing less often, repairing failures faster, or both. Recovery speed often gives a cheaper improvement than redesigning every component.
def availability_from_mtbf(mtbf_hours, mttr_hours):
return mtbf_hours / (mtbf_hours + mttr_hours)
print(availability_from_mtbf(1000, 1)) # 0.999000999...
print(availability_from_mtbf(1000, 0.1)) # 0.999900009...Reducing MTTR from one hour to six minutes adds roughly one nine in this example. This requires effective detection, clear runbooks, safe rollback, and systems that can replace failed instances.
SLIs, SLOs, and SLAs
An SLI (service level indicator) is a measured value, such as the fraction of successful requests. An SLO (service level objective) is the target for that indicator, such as 99.9% successful requests over 30 days. An SLA (service level agreement) is a customer-facing contract that may define remedies when targets are missed.
| Term | Meaning | Example |
|---|---|---|
| SLI | What you measure | Successful requests / total requests |
| SLO | Internal reliability target | At least 99.9% in 30 days |
| SLA | Contractual commitment | Credit if availability falls below 99.9% |
Error Budgets in Practice
An error budget is the failure amount permitted by an SLO. For a request-based SLO:
\[ \text{budget} = (1-\text{SLO}) \times \text{total requests} \]
A 99.9% SLO over 10 million requests permits 10,000 failed requests. Teams can spend this budget on releases, migrations, or experiments. If the budget is nearly exhausted, they should prioritize reliability work.
How Dependencies in Series Lower Availability
Components in series all must work for a request to succeed. Their combined availability is the product of their individual availabilities. Three dependencies at 99.9% availability provide only about 99.7% combined availability.
Exercise
A service has an MTBF of 500 hours and an MTTR of 5 hours. What is its approximate availability?
Show answer
500 / (500 + 5) = 0.9901, or about 99.01%.