S4 · Lesson 43 · Dependability
MTTF, MTTR and availability, failure rates in series, redundancy, nines and RAID
Every component eventually fails: disks, fans, power supplies, memory chips, whole servers. A dependable system keeps working anyway, and designing one starts with a few numbers. How long, on average, until a part fails? How long to repair it? How do failure rates combine when a system needs every part to work, and how much does a spare copy buy when it needs only one? The arithmetic is simple and its consequences are large: two replicas of a 99.9%-available service give 99.9999%, while chaining ten 99.9% components in series gives only 99%.
- Availability of a service with k independent replicas, each available a fraction a of the time, measured in nines: with .
- Each replica multiplies the unavailability by : at a = 99.9%, every extra copy adds three nines (if failures really are independent).
- Correlated failures (a shared power feed, the same software bug everywhere) break the independence assumption, which is why real systems spread replicas across racks, buildings and regions.
Predict
A server's parts have MTTFs of 1,000,000 hours (each of two disks), 200,000 hours (power supply), 500,000 hours (motherboard) and 100,000 hours (fan), and the server needs all of them. What's its MTTF?
Failure rates add when every part is needed: 2/10⁶ + 1/(2 × 10⁵) + 1/(5 × 10⁵) + 1/10⁵ = 1.9 × 10⁻⁵ per hour, so MTTF = 52,600 hours, about 6 years, shorter than the weakest part alone. The fan dominates, and a redundant fan would raise the server's MTTF more than better disks would.
Name it
Measures
- MTTF (mean time to failure), MTTR (mean time to repair), MTBF = MTTF + MTTR.
- Availability , often quoted in nines: 99.99% is "four nines", about 53 minutes of downtime a year.
- Failure rate (assuming a constant rate, the flat middle of the bathtub curve). FIT = failures per device-hours.
Combining parts
- Series (all needed): rates add, , so ; availability multiplies, .
- Parallel (any one suffices): unavailability multiplies, .
RAID
- RAID 1 mirrors each disk; RAID 5 spreads one parity block per stripe across N disks and survives any single failure; RAID 6 survives two.
- Data is lost if a second disk fails during the repair window. For N disks of MTTF M and repair time R, RAID 5's mean time to data loss is about
(In practice unrecoverable read errors during rebuild and correlated failures make it much shorter, which is why large arrays use RAID 6 or erasure codes.)
Worked example
For the server above, with a 24-hour repair time, what's the availability and the downtime per year?
Show the solution
- Availability. The MTTF is 52,632 hours: three nines and a bit.
- Downtime. a year.
- Two servers behind a load balancer. If they fail independently, the unavailability is about 7 seconds a year.
Answer the availability is 0.99954, about 240 minutes of downtime a year.
Worked example
A RAID 5 array has 8 disks with an MTTF of 1,000,000 hours and a 24-hour rebuild. What's its MTTDL?
Show the solution
- MTTDL. about 85,000 years.
- Compare with one disk. A single disk's MTTF is 114 years, so parity buys a factor of several hundred.
- The catch. That holds only as long as the second failure really is independent of the first and the rebuild reads every sector cleanly.
Answer the MTTDL is about hours, roughly 85,000 years.
Worked example
A service needs one load balancer (99.99% available) in series with a pair of replicated servers, each 99% available, either of which can carry the load. What is its availability, and its downtime per year?
Show the solution
- The pair. It's unavailable only when both servers are:
- In series with the balancer. about 105 minutes of downtime a year.
- The weak link. Replicating the servers turned two nines into four, and the balancer is now as weak a link as they are.
Answer the service is 0.9998 available, about 105 minutes of downtime a year.
Check
A component has an MTTF of 50000 hours and takes 2 hours to repair. What's its unavailability, in parts per million?
Check
A system needs three parts with MTTFs of 100000, 500000 and 200000 hours. What's its MTTF?
Check
A service runs 2 independent replicas, each available 0.999 of the time. How many nines of availability does it have?
Check
A service is available 0.995 of the time. How many minutes of downtime is that per year?
Check
A RAID 5 array of 8 disks has an MTTF of 500000 hours per disk and a 48-hour rebuild. What's its MTTDL, in years?
Check
A request passes through 10 components in series, each available 0.999 of the time. What's the end-to-end unavailability?
Check
A system has an MTTF of 10000 hours and a repair time of 1 hours.
(a)
What is its unavailability, one minus the availability?
(b)
How much downtime does it have per year?
Check
A RAID 5 array has 4 disks with an MTTF of 100000 hours and a 48-hour rebuild.
(a)
What is its mean time to data loss?
Check
Two parts have MTTFs a and b, and availabilities p and q.
Step 1
What is the MTTF of the pair in series?
Type it the way you would write it, like 3sin(2πft) or 3*sin(2*pi*f*t). Angles can be in radians or carry a degree sign, like 45°.
Step 2
What is their availability in series?
Step 3
And in parallel?
Explain why
Why does redundancy improve availability so dramatically, and what limits it in practice?
With independent replicas, the service is down only when all of them are down at once. If each is unavailable a small fraction of the time, the chance that all are down together is that fraction raised to the number of replicas, so each extra replica multiplies the downtime by a small number, adding several nines. The catch is independence. Replicas that share a power supply, a network switch, a building, a software version or a configuration change can fail together, and then the downtime is set by that shared cause, not by the product. Real systems gain most of redundancy's benefit only by separating replicas in every way they can, and by repairing failures quickly so the window for a second failure stays short.
Practice
Keep practicing
11 kinds of problem on this topic, dealt one at a time with new numbers every time, for as long as you like.