OpenUptime

SLA and uptime calculator

Turn an uptime target into the downtime it allows, track an error budget, or work out the uptime of services that depend on each other. The numbers update as you type.

SLA 与可用率计算器

把可用率目标换算成允许的停机时间,跟踪错误预算,或计算互相依赖的服务的整体可用率。输入后结果会立即更新。

Uptime → allowed downtime可用率 → 允许的停机时间

Daily每天1m 26s1 分 26 秒
Weekly每周10m 5s10 分 5 秒
Monthly每月43m 48s43 分 48 秒
Quarterly每季度2h 11m 24s2 小时 11 分 24 秒
Yearly每年8h 45m 36s8 小时 45 分 36 秒

To measure this monthly target, check at least every 4m 23s.要测量这个月度目标,检查间隔应不超过 4 分 23 秒。

Downtime → uptime停机时间 → 可用率

99.9315% uptime可用率

Error budget错误预算

27.4% of the budget used的预算已用掉

Budget 43m 48s, 31m 48s left.预算 43 分 48 秒,剩余 31 分 48 秒。

Combined uptime of several services多个服务的整体可用率

99.8401% combined uptime整体可用率

Availability from MTBF and MTTR由 MTBF 和 MTTR 计算可用率

99.9306% availability可用率

Downtime allowed by common targets

UptimeDailyWeeklyMonthlyYearly
90% one nine2h 24m16h 48m3d 1h36d 12h
95%1h 12m8h 24m1d 12h 30m18d 6h
99% two nines14m 24s1h 40m 48s7h 18m3d 15h 36m
99.5%7m 12s50m 24s3h 39m1d 19h 48m
99.9% three nines1m 26s10m 5s43m 48s8h 45m 36s
99.95%43.2s5m 2s21m 54s4h 22m 48s
99.99% four nines8.6s1m4m 23s52m 34s
99.995%4.3s30.2s2m 11s26m 17s
99.999% five nines0.86s6s26.3s5m 15s

A month here is the average month, a twelfth of a 365-day year. Follow a target for what it takes and how to measure it.

Formulas

Allowed downtime(100% − uptime) × length of the period
Uptime100% × (1 − downtime ÷ length of the period)
Services that all have to workuptime₁ × uptime₂ × …
Redundant copies, any one is enough1 − (1 − uptime₁) × (1 − uptime₂) × …
Availability from failures and repairsMTBF ÷ (MTBF + MTTR)
Error budget leftallowed downtime − downtime so far

Why monthly numbers differ

Calculators and contracts do not agree on how long a month is. Some use 30 days, some the calendar month, some a twelfth of the year. At 99.9% the difference is a minute or more:

Average month (30.42 days)43m 48s
30-day month43m 12s
31-day month44m 38s
28-day month40m 19s

What each level asks of a team

  • 99% (two nines): About 7 hours a month. Someone can notice a problem during working hours and fix it by hand.
  • 99.9% (three nines): About 44 minutes a month. Outages have to page someone, and one slow fix can use the whole month.
  • 99.95%: About 22 minutes a month. Deploys need a quick rollback and on-call has to respond within minutes.
  • 99.99% (four nines): About 4 minutes a month, less than a person needs to wake up and log in. Recovery has to be automatic: health checks, failover, redundancy in more than one location.
  • 99.999% (five nines): About 26 seconds a month. Every dependency, including DNS, the network and the database, has to be redundant, and maintenance cannot take anything offline.

Your uptime cannot beat the parts it depends on unless they are redundant: a service at 99.99% that needs a database and a cache at 99.9% each can deliver at most about 99.79%.

Measure it with the right check interval

A monitor that checks every n seconds sees an outage only at its next check, and counts each outage in steps of n. Short outages can slip between two checks and long ones can be counted up to one interval too long. To keep that error small next to the budget, check at most every tenth of it.

OpenUptime checks as often as every 30 seconds on the Team plan, every minute on Lite and Starter and every 5 minutes on Free, and can check one monitor from several regions. Each check result is recorded, and uptime is shown per monitor and on 90-day status page bars.

Questions

How much downtime is 99.9% uptime?

About 1 minute 26 seconds a day, 43 minutes 48 seconds in an average month and 8 hours 45 minutes a year.

How much downtime does 99.99% allow?

About 8.6 seconds a day, 4 minutes 23 seconds in an average month and 52 minutes 34 seconds a year.

Why do calculators show different monthly downtime?

They use different month lengths. At 99.9%, a 30-day month allows 43m 12s, an average month (a twelfth of a year) 43m 48s and a 31-day month 44m 38s. Use the month your contract defines.

What is the uptime of services that depend on each other?

When all of them have to work, multiply their uptime: three services at 99.9% give about 99.7%. When any one copy is enough, as with redundant servers, multiply their failure rates instead: two copies at 99% give 99.99%.

What is the difference between SLA, SLO and SLI?

The SLI is what you measure (the share of successful checks), the SLO is the target you set for it, and the SLA is the promise in a contract, usually with credits when it is missed. Keep the SLO stricter than the SLA so you notice trouble before the contract is breached.

What is an error budget?

The downtime an SLO leaves you over a period: 0.1% of the month at 99.9%. While budget is left, teams ship changes as usual; once it is spent, they slow down and work on reliability.

How often do I need to check to measure 99.9% or 99.99%?

As a rule of thumb, at most a tenth of the budget: about 4 minutes for 99.9% a month, so a check every minute works. For 99.99% a tenth of the monthly budget is 26 seconds, shorter than the 30-second minimum, so measure it over a quarter or a year.

Does planned maintenance count as downtime?

That depends on the contract. Many SLAs exclude announced maintenance windows, others count every minute. Read the definition of downtime in yours before you compare numbers.

常见目标允许的停机时间

可用率每天每周每月每年
90% 1 个 92 小时 24 分16 小时 48 分3 天 1 小时36 天 12 小时
95%1 小时 12 分8 小时 24 分1 天 12 小时 30 分18 天 6 小时
99% 2 个 914 分 24 秒1 小时 40 分 48 秒7 小时 18 分3 天 15 小时 36 分
99.5%7 分 12 秒50 分 24 秒3 小时 39 分1 天 19 小时 48 分
99.9% 3 个 91 分 26 秒10 分 5 秒43 分 48 秒8 小时 45 分 36 秒
99.95%43.2 秒5 分 2 秒21 分 54 秒4 小时 22 分 48 秒
99.99% 4 个 98.6 秒1 分4 分 23 秒52 分 34 秒
99.995%4.3 秒30.2 秒2 分 11 秒26 分 17 秒
99.999% 5 个 90.86 秒6 秒26.3 秒5 分 15 秒

这里的一个月指平均月,即 365 天的十二分之一。 点击目标可查看要做到它需要什么、怎样测量。

计算公式

允许的停机时间(100% − 可用率)× 周期长度
可用率100% ×(1 − 停机时间 ÷ 周期长度)
都必须正常的多个服务可用率₁ × 可用率₂ × …
冗余部署,只需一份正常1 −(1 − 可用率₁)×(1 − 可用率₂)× …
由故障间隔和修复时间求可用率MTBF ÷(MTBF + MTTR)
剩余错误预算允许的停机时间 − 已发生的停机时间

为什么每月的数字各不相同

计算器和合同对一个月有多长并不统一:有的按 30 天,有的按自然月,有的按一年的十二分之一。在 99.9% 下,差别可达一分钟以上:

平均月(30.42 天)43 分 48 秒
30 天43 分 12 秒
31 天44 分 38 秒
28 天40 分 19 秒

每个级别对团队意味着什么

  • 99%(2 个 9): 每月约 7 小时。在工作时间里发现问题、手动修复就来得及。
  • 99.9%(3 个 9): 每月约 44 分钟。故障必须能及时通知到人,一次修得慢就可能用完整月的预算。
  • 99.95%: 每月约 22 分钟。发布要能快速回滚,值班人员要在几分钟内响应。
  • 99.99%(4 个 9): 每月约 4 分钟,比一个人醒来并登录系统的时间还短。恢复必须自动完成:健康检查、故障切换、多地点冗余。
  • 99.999%(5 个 9): 每月约 26 秒。DNS、网络、数据库等每个依赖都要冗余,维护时也不能让任何部分下线。

除非依赖是冗余的,否则你的可用率不可能高于你所依赖的部分:一个 99.99% 的服务如果依赖各为 99.9% 的数据库和缓存,最多只能做到约 99.79%。

用合适的检查间隔来测量

每 n 秒检查一次的监控,只有在下一次检查时才能发现故障,并且以 n 秒为单位计算每次故障的时长。很短的故障可能落在两次检查之间而被漏掉,较长的故障最多可能被多算一个间隔。为了让误差相对预算足够小,检查间隔不要超过预算的十分之一。

OpenUptime 在 Team 套餐中最快每 30 秒检查一次,Lite 和 Starter 每分钟一次,Free 每 5 分钟一次,并且可以从多个区域检查同一个监控。每次检查结果都会被记录,可用率会显示在每个监控以及状态页的 90 天条形图上。

常见问题

99.9% 的可用率意味着多少停机时间?

大约每天 1 分 26 秒、平均每月 43 分 48 秒、每年 8 小时 45 分。

99.99% 允许多少停机时间?

大约每天 8.6 秒、平均每月 4 分 23 秒、每年 52 分 34 秒。

为什么不同计算器算出的每月停机时间不一样?

因为它们对一个月的长度定义不同。以 99.9% 为例,30 天的月允许 43 分 12 秒,平均月(一年的十二分之一)允许 43 分 48 秒,31 天的月允许 44 分 38 秒。请以合同里的定义为准。

互相依赖的服务,整体可用率是多少?

如果它们都必须正常,就把可用率相乘:三个 99.9% 的服务合起来约为 99.7%。如果只要有一份正常就行(例如冗余部署的服务器),就把故障率相乘:两份 99% 合起来是 99.99%。

SLA、SLO 和 SLI 有什么区别?

SLI 是你测量的指标(例如成功检查的比例),SLO 是你为它定的目标,SLA 是写进合同的承诺,未达成时通常需要赔付。SLO 应比 SLA 更严格,这样在违约之前就能发现问题。

什么是错误预算?

错误预算是 SLO 在一个周期内留给你的停机时间,例如 99.9% 对应当月 0.1% 的时间。预算还有剩余时照常发布;用完之后就放慢节奏,优先处理稳定性。

要测量 99.9% 或 99.99%,需要多久检查一次?

经验上,检查间隔不要超过预算的十分之一:99.9% 每月约为 4 分钟,所以每分钟检查一次就够了。99.99% 每月预算的十分之一只有 26 秒,比最短的 30 秒间隔还短,因此适合按季度或按年来衡量。

计划内维护算停机吗?

取决于合同。很多 SLA 不计入提前公告的维护窗口,也有的每一分钟都算。比较数字之前,先看清合同里对停机的定义。