Availability and the nines
Being there when asked
Section titled “Being there when asked”The share of the time that a system is there when someone asks for it is its availability. It is the property that users notice first, because they see it directly: the page loads, or it does not.
There are two ways to measure it, and the difference matters.
- By time: the share of a period during which the system was up. Availability is uptime ÷ (uptime + downtime).
- By requests: the share of requests that succeeded. Google’s SRE book describes this as the better measure for a service that is partly working all the time, and gives an example: a system that serves 2.5 million requests a day, with a daily target of 99.99%, can serve up to 250 errors and still meet it.
The two agree when traffic is even. They disagree when it is not: an hour of downtime at 4 a.m. costs far fewer requests than an hour at the peak.
Availability is usually quoted as a percentage with “nines”: 99.9% is “three nines”, 99.99% is “four nines”.
What each nine allows
Section titled “What each nine allows”Each extra nine cuts the allowed downtime by a factor of ten. The calculator below shows what each level allows over a year, a 30-day month and a day. Set the availability to any value to see where it falls.
Availability calculator
Your numbers
The share of time one copy of one component works. 99.9% means it is down about 8.8 hours a year. A provider's published figure is a promise, so measure what you actually get.
How many components in a row must all work for a request to succeed: the hard dependencies of the request path, each counted once.
How many copies of each component can serve a request, so that one failure does not stop it. 1 means no redundancy.
Changing the numbers needs JavaScript. The result is for the starting numbers.
Result
System availability99.9%
That allows 8.76 h of downtime a year.
How it is calculated
Each step shows its formula, the numbers that go in, and the figure that comes out.
One component, with its copies
A_c = 1 − (1 − a)^r
A group of copies is down only when every copy is down at the same time, so its unavailability is one copy's unavailability to the power r.
- a availability of one copy
- 99.9%
- r copies of each component
- 1
A_c availability of one component, with its copies99.9%
The whole chain
A = A_c^n
A request needs every component in the chain, so the availabilities multiply. The chain is up only when all of them are.
- A_c availability of one component, with its copies
- 99.9%
- n components in the chain
- 1
A system availability99.9%
Downtime in a year
D = (1 − A) × T
The time the chain is down is the unavailable share of the year (365 days).
- A system availability
- 99.9%
- T time in a year
- 365 d
D downtime in a year8.76 h
| Availability | Down per year | Down per month (30 days) | Down per day |
|---|---|---|---|
| 99% | 3.65 d | 7.2 h | 14.4 min |
| 99.9% · your system | 8.76 h | 43.2 min | 1.44 min |
| 99.95% | 4.38 h | 21.6 min | 43.2 s |
| 99.99% | 52.6 min | 4.32 min | 8.64 s |
| 99.999% | 5.26 min | 25.9 s | 864 ms |
Model notes
Assumptions
- Components fail independently of one another. Failures with a shared cause (a bad deploy, one power supply, one data centre) break this, so real copies are less independent than this, and the real availability is lower than the figure here.
- A copy takes over instantly and completely when another fails. Real failover takes time, and requests fail while it happens, so copies buy fewer nines than the arithmetic says.
Simplifications
- Availability here is the share of time that the system is up. Many teams measure the share of requests that succeed instead, which is about the same only when traffic is even through the day.
- The calculator does not claim more than twelve nines. Beyond about six, a figure says more about the model's assumptions than about any real system, and the arithmetic cannot tell a copy's failure from a shared one.
- A year is 365 days and a month is 30 days.
Parameter values are illustrative. They are not benchmarks of any real product.
Read the table as a budget. A system that is 99.9% available may be down for 8.76 hours a year. At 99.99% that is 52.6 minutes, and at 99.999% it is 5.26 minutes. The SRE book calls the allowed amount of failure an error budget: a team that stays within it can ship changes, and one that has used it up has a reason to slow down.
The numbers also show why the top levels are expensive. 99.99% allows 4.32 minutes of downtime in a 30-day month (43.2 minutes at 99.9%). A single deploy that takes the site down for ten minutes uses up more than a month’s budget for four nines. To keep that budget, no one can be in the loop for every recovery: it has to be automatic.
Availability from failures and repairs
Section titled “Availability from failures and repairs”A system fails now and then, and each time it is repaired. Two averages describe that:
- MTBF, the mean time between failures: how long it normally runs before a failure.
- MTTR, the mean time to recover: how long it takes to be back, including the time to notice that something is wrong.
Availability follows from them: A = MTBF ÷ (MTBF + MTTR).
| MTBF | MTTR | Availability |
|---|---|---|
| 1,000 hours | 1 hour | 99.9% |
| 1,000 hours | 30 minutes | 99.95% |
| 2,000 hours | 1 hour | 99.95% |
The last two rows give the same result: recovering twice as fast improves availability as much as failing half as often. That is a useful fact, because failing less often is hard, since faults are caused by hardware, software and people, and recovering faster is usually in your hands. AWS lists the same three levers: fail less often, detect failures faster, and repair them faster.
A warning from the same source: MTBF and MTTR are averages, and for software they are hard to predict, so a forecast availability is an estimate and not a guarantee.
Try it: lose instances, and watch the sums
Section titled “Try it: lose instances, and watch the sums”The lab below is a load balancer, four API instances and a database. Traffic starts at 4,500 requests per second. Each instance can serve 2,000 per second, so four can serve 8,000, and the API is at 56% of its capacity.
Use API instances killed to take instances down, and read the panel under the diagram.
Requests pass a load balancer to four API instances, which read a database. Kill instances and watch the share of requests that are still served, what that would add up to over a year, and how many instances the system can lose before it starts to fail requests.
Each dot stands for many requests. The numbers show the real rate.
No bottleneck: every component has headroom.
Availability at this traffic
- Requests served
- 100%Every request is served, so there is no downtime to count.
- API instances up
- 4 of 4
The API can lose 1 of its 4 instances and still serve every request.
| Instances lost | Instances left | Capacity (req/s) | Utilisation | Requests served | State |
|---|---|---|---|---|---|
| 0 · now | 4 | 8K | 56% | 100% | Busy |
| 1 | 3 | 6K | 75% | 100% | Degraded |
| 2 | 2 | 4K | 113% | 89% | Overloaded |
| 3 | 1 | 2K | 225% | 44% | Overloaded |
| 4 | 0 | 0 | — | 0% | Down |
| Component | State | Utilisation | Offered (req/s) | Served (req/s) | Rejected (req/s) | p50 | p95 | p99 |
|---|---|---|---|---|---|---|---|---|
| Clients | Healthy | <1% | 4.5K | 4.5K | 0 | 0 ms | 0 ms | 0 ms |
| Load balancer | Healthy | <1% | 4.5K | 4.5K | 0 | 0.03 ms | 0.15 ms | 0.23 ms |
| API | Busy | 56% | 4.5K | 4.5K | 0 | 5.5 ms | 24 ms | 37 ms |
| Database | Healthy | 45% | 4.5K | 4.5K | 0 | 2.8 ms | 12 ms | 18 ms |
- Traffic
- 4,500 req/s
- Successful
- 4,500 req/s
- Error rate
- 0%
- Mean latency
- 13 ms
Illustrative values, not benchmarks of any real product.
Model notes
Assumptions
- Requests arrive at random, as a Poisson process, at a constant average rate.
- Each node is one queue, served first-come first-served by several identical slots (instances × concurrency).
- Service times are random with the stated mean; by default they are exponentially distributed.
- Each node is analysed separately, with the traffic it receives treated as Poisson.
- Killed instances stay down while you look at them, and the load balancer sends traffic only to the instances that are up, noticing at once.
Simplifications
- Above capacity there is no steady state. The model switches to a fluid approximation: the node serves at capacity, its queue grows until it reaches its limit, and further requests are rejected.
- Percentiles assume an exponential tail. A service-time variability other than exponential changes the mean wait but not the shape of the tail.
- A node frees its slot as soon as it has done its own work, before waiting on the services it calls. Real thread-per-request servers hold the slot, so a slow dependency exhausts them faster than this model shows.
- A request calls its dependencies one after another. Parallel fan-out is not modelled.
- When a caller times out and gives up, the callee still finishes the work, so abandoned requests keep consuming capacity.
- Retries add load. Their backoff and jitter decide when that load arrives, which only the per-request simulation shows.
- Retry feedback is solved from the healthy starting point, so it finds one stable outcome. Systems that stay stuck in overload after the cause is gone are not shown.
- A throughput limit (for example maximum writes per second) is modelled as slower service, not as a separate rate limiter.
- A caller’s timeout counts the mean time its dependencies take, not their full distribution.
- The load balancer and the database are single copies here, so they are the next single points of failure. This lab kills only API instances.
- Availability here is the share of requests served at steady state under constant traffic. A real failure has a transition, with detection, failover and queues, that this does not show.
Parameter values are illustrative. They are not benchmarks of any real product.
- With none killed, every request is served.
- With one killed, three instances can serve 6,000 per second, which is still more than 4,500. Every request is served, and the system is running with no spare.
- With two killed, the two left can serve 4,000 per second against 4,500 asked, so only 4,000 of the 4,500 requests are served: 89%. If that lasted for a year, the requests that fail would add up to about 40 days of downtime.
- With three killed, 2,000 of 4,500 are served: 44%.
The panel’s sentence says how many instances can be lost with nothing failing: here, one. That number is set by headroom, the capacity beyond what traffic needs. Four instances at 56% can lose one. Raise the traffic until the API is near its limit and they can lose none. Lower it and they can lose three.
This is the rule behind “N+1”: to survive the loss of one instance, you need the load to fit on the others, so the system has to be run with the spare capacity of at least one instance. It is why a system at 90% utilisation is not a highly available system, however many instances it has.
What happens if one instance fails at 80% load?
Section titled “What happens if one instance fails at 80% load?”Traffic is 6,400 requests per second, which is 80% of the 8,000 that four instances can serve. A bad deploy kills one instance.
The three left can serve 6,000. Demand is 6,400. They serve 6,000 of 6,400 requests, which is 93.75%, and the 6.25% that cannot be served fail or wait. For as long as it lasts, the availability is 93.75%, which is nowhere near three nines. And it is worse in practice than the arithmetic says. The load balancer takes some time to notice that an instance is gone, and during that time it sends requests to a dead instance. The instances that remain are running hot, so their latency rises, and the clients that time out retry, which adds more load.
The system had four instances and looked redundant. It was not, because at 80% there was no room for one to fail. Redundancy is not the number of copies, it is the capacity left over.
Targets: SLI, SLO and SLA
Section titled “Targets: SLI, SLO and SLA”Three terms are often confused.
- An SLI (service level indicator) is a measurement: the share of requests that succeed, or the latency of requests.
- An SLO (service level objective) is a target for an SLI: 99.9% of requests succeed over 30 days. It is internal, and the team works to it.
- An SLA (service level agreement) is a promise to a customer, with consequences, usually money, if it is missed. SLAs are usually looser than the SLOs behind them, so the team has room to miss its own target without paying.
AWS’s whitepaper gives one more rule: choose dependencies whose availability goals are equal to or greater than your own. If your SLO is 99.99%, a hard dependency that is only 99.9% available makes it unreachable.
- Availability is the share of time, or of requests, that a system is there when asked. Counting requests is usually better.
- Each nine cuts allowed downtime by ten: 8.76 hours a year at 99.9%, 52.6 minutes at 99.99%, 5.26 minutes at 99.999%.
- Availability is MTBF ÷ (MTBF + MTTR). Recovering twice as fast improves it as much as failing half as often.
- Spare capacity, not the number of copies, decides how many instances can fail without losing requests. A system at 80% load cannot lose one.
- A target is an SLO, a measurement is an SLI, and a promise with a penalty is an SLA.
- Pick dependencies that are at least as available as the target you set for yourself.
Next: reliability, resilience and fault tolerance, which are not the same thing.
Your progress
Built by GhaziAlibi.
© ShardCraft. All rights reserved.