MTBF and MTTF
Mean time between failures (MTBF) is the average working time between one failure and the next, for systems you repair and put back into service:
MTBF = total uptime / number of failuresMean time to failure (MTTF) is the same idea for things you replace rather than repair, such as a disk. It is the average time until the first and only failure.
MTTR and its four meanings
MTTR is the average time a failure keeps the system out of service:
MTTR = total downtime / number of failuresThe letters are shared by four different measurements, and reports often mix them up:
- Mean time to repair: the time spent repairing and testing until the system works again.
- Mean time to recovery (or restore): from the moment of failure until service is back. This is the one that matches downtime and the one to use for availability.
- Mean time to respond: recovery timed from the first alert rather than from the moment of failure.
- Mean time to resolve: until the underlying cause is fixed so it will not happen again, which can be long after service is restored.
Mean time to acknowledge (MTTA) is the time from an alert to someone starting work on it, and it is part of recovery time.
From MTBF and MTTR to availability
availability = MTBF / (MTBF + MTTR)A system that runs 999 hours on average between failures and takes 1 hour to recover is up 999 of every 1,000 hours, which is 99.9%. The formula only holds when MTTR means recovery time, the whole span the service is down.
A worked example
Over 30 days (720 hours) a service fails 3 times and is down for 6 hours in total. It was up 714 hours, so MTBF is 238 hours, MTTR is 2 hours and availability is 99.1667%.
Recovering in one hour instead of two raises it to 99.5833%. Avoiding half the failures instead (MTBF of 476 hours at the same 2-hour MTTR) gives 99.5816%. Detection is part of recovery, so a monitor that finds the outage in one minute instead of fifteen cuts about 14 minutes from every incident, if the rest of the response stays the same.