Defining high availability
easy 25 minAvailability is the share of time, or of requests, that a system works for its users.
See it run
What a nine means in minutes, how it is measured, why parts multiply, and how a budget gets spent.
Operations
Climb the nines
From two nines to six: one row at a time, with the downtime it leaves in a year and in a 30-day month.
Step 1 of 5
Two nines
| Target | Down per year | Down per month | |
|---|---|---|---|
| 2 nines | 99% | 3.65 days | 7.2 hours |
| 3 nines | |||
| 4 nines | |||
| 5 nines | |||
| 6 nines |
1% of 365 days = 3.65 days
99% sounds high, but 1% of a year is 3.65 days. Users would call it unreliable.
Step 1: Two nines
def allowed_minutes(target, days): total = days * 24 * 60 return total * (100 - target) / 100- Period
- Year, month
- You learn
- Minutes allowed
- Each extra nine
- 10x less downtime
Learn two numbers: 99.9% is 43 minutes a month. Multiply or divide by ten for the neighbours.
In the real world
The same defining high availability doing real jobs. Pick one and step through it.
The same crash on the busiest day of the year, without and with a spare.
Step 1 of 4
Without a spare
One server
One server sells everything. It is the busiest hour.
Step 1: Without a spare
Common mistakes
The bugs interviewers watch for, with the fix beside each.
A target without a period
major99.9% of a day is 86 seconds, of a year 8.76 hours. Without the period the number cannot be checked.
Wrongtarget = "99.9%"Righttarget = ("99.9%", "good requests", "30 days")Averaging the chain
criticalParts that are all needed multiply. The average hides that the chain is worse than its worst part.
Wrongtotal = sum(parts) / len(parts)Righttotal = 1.0for p in parts: total *= pSLO looser than the SLA
criticalYou would break the contract before your own alarm rings.
Wrongsla = 99.9slo = 99.5Rightsla = 99.9slo = 99.95 # stricterCounting one outage twice
minorTwo alerts for the same minutes make the outage look twice as long.
Wrongdown = sum(b - a for a, b in alerts)Rightdown = sum(b - a for a, b in merge_overlaps(alerts))
Interview tips
How to explain it
- Good time over total time, or good requests over all.
- Count the nines, name the period.
- Say what the number forces, such as automatic failover.
Memory trick: NINES
- Number of nines, Inverse to downtime.
- Next nine is ten times less, and Expensive.
- SLA is the promise.
Raise it by
- Recovering faster: failover, rollback, runbooks.
- Failing less: tests, spares, capacity.
- Making dependencies soft.
Watch out for
- Dependencies with fewer nines than your target.
- Metrics from inside a server that may be dead.
- Planned maintenance that nobody counts.