ScienceComputer Science

Uptime and SLA
calculator.

See how much downtime an uptime target allows, or what an outage did to your uptime.

How it's worked out

An uptime target is the share of time a service must be working. Whatever is left is the downtime it may have, so the allowance for any period is that leftover share times the length of the period:

leftover share\displaystyle \text{leftover share}=1−uptime\displaystyle {}= 1 - \text{uptime}
allowed downtime\displaystyle \text{allowed downtime}=leftover share×period length\displaystyle {}=\;\text{leftover share} \times \text{period length}

A 365-day year has 525,600 minutes, so 99.9% allows 8 h 46 min a year. A 30-day month has 43,200 minutes, so the same target allows 43.2 minutes a month. Each extra nine cuts the allowance tenfold: 99.99% allows 52.6 minutes a year and 99.999% only 5.3 minutes.

Going the other way, the uptime you achieved is one minus the downtime as a share of the period:

uptime\displaystyle \text{uptime}=1\displaystyle {}= 1−minutes downminutes in the period\displaystyle {}- \frac{\text{minutes down}}{\text{minutes in the period}}

When a request needs several services and every one must be up, they are in series, and their availabilities multiply. When any one of several copies can serve the request, they are in parallel, and the system is down only when all of them are down at once:

Aseries\displaystyle A_{\text{series}}=A1×A2×A3\displaystyle {}= A_1 \times A_2 \times A_3
Aparallel\displaystyle A_{\text{parallel}}=1−(1−A1)(1−A2)\displaystyle {}= 1 - (1 - A_1)(1 - A_2)

Both formulas assume the parts fail on their own, independently of each other. Shared power, networks, regions or a bad release break that assumption, so treat the parallel figure as a best case.

Worked examples

A 99.95% SLA and this month’s budget

A hosting contract promises 99.95% uptime. That is about 3.3 nines and allows 4 h 23 min a year, or 21.6 minutes in a 30-day month.

A deploy went wrong earlier this month and the site was down for 15 minutes. Treating the allowance as an error budget, 6.6 minutes is left for the rest of the month, so one more outage of that size would break the SLA.

Open this example in the tool

An outage in a 31-day month

An API was down for 45 minutes in March, a 31-day month of 44,640 minutes. Its uptime was 99.8992%.

That misses a 99.9% target, which allows 44.6 minutes in that month, by less than a minute. It still meets 99.5%, which allows 3 h 43 min. Measured against a 30-day month the allowance would be 43.2 minutes, so the month length decides close calls like this one.

Open this example in the tool

A request through three services

A request passes a load balancer at 99.95%, an app at 99.9% and a database at 99.99%. All three must be up, so multiply: 99.8401%, which allows about 14 h 1 min of downtime a year. That is lower than any single part.

Redundancy works the other way. Two independent servers at 99% each give 99.99% when either one can answer, cutting the yearly downtime from 3 d 15 h 36 min to 53 min.

Open this example in the tool

Reading your result

In downtime mode the big figure is the yearly allowance and the line under it is the month. The row below gives the month, a week and a day, and the tiles add a quarter of 91.25 days, an hour and the number of nines. A target such as 99.95% is about 3.3 nines, not three and a half.

The month length matters for monthly SLAs. At 99.9%, February's 28 days allow 40.3 minutes and a 31-day month allows 44.6 minutes. Many contracts measure a calendar month, so check how yours defines one.

The what-if buttons move the target by a whole nine. From 99.9%, one more nine is 99.99%, which leaves a tenth of the downtime. That usually means more redundancy, automated failover and faster on-call response, so price it before promising it.

In uptime mode the tiles test the outage against 99.9%, 99.95% and 99.99% in the same period. In combine mode the result is the availability the whole chain can promise, at best.

Common mistakes

  • Promising your providers' number. A service built on two parts at 99.9% each, both needed, can only offer 99.8001%, not 99.9%.
  • Counting redundancy as fully independent. Two copies in the same region or behind the same load balancer often fail together. The load balancer is a part in series with the pair.
  • Mixing up calendar months and 30-day months. A 45-minute outage misses 99.9% in a 31-day month, but a contract with a 30-day month gives a smaller allowance still. Use the length your contract states.
  • Leaving out planned maintenance without checking. Some contracts exclude announced maintenance windows and some count every minute down.
  • Measuring only whole outages. A service that fails 2% of requests for an hour is not fully down, but users feel it. Request-based availability, successful requests over all requests, catches this.

Questions people ask

About 43.2 minutes in a 30-day month and 44.6 minutes in a 31-day month. Over a 365-day year it is 8 h 46 min, and in a week about 10.1 minutes.

Sources