Uptime
Uptime is the share of a period during which a service worked as expected, usually given as a percentage such as 99.9%.
In practice uptime is measured by checking the service from outside at a fixed interval: an HTTP request, a TCP connection, a DNS lookup. Each check passes or fails, and uptime is the passed time divided by the whole period.
The number depends on what counts as working. A page that loads but shows an error, or answers in 20 seconds, may still pass a check that only looks at the status code. Keyword checks and response-time limits make the number closer to what users experience.
It also depends on the period and on what is excluded. A monthly figure hides less than a yearly one, and many contracts leave out announced maintenance.
At a glance
uptime = time up ÷ length of the period × 100%
In OpenUptime
OpenUptime records every check and shows uptime per monitor and as 90-day bars on status pages. A monitor goes down after a set number of failed checks in a row (3 by default), so one dropped request does not count as an outage.
Turn an uptime target into allowed downtime →
Questions
Is 100% uptime possible?
Over a short period, yes; as a promise, no. Hardware, networks and deploys all fail sometimes, which is why targets are written as a number of nines.
How often should uptime be checked?
Often enough that the interval is small next to the downtime you allow: about a tenth of the budget is a common rule. For 99.9% a month that is every 4 minutes or less.
Related terms
Monitor it with OpenUptime
Checks from one or several regions, alerts to the tools you use, and a status page for your customers. Free to start, open source under the MIT license.
可用时间(Uptime)
Uptime 指在一段时间内,服务按预期正常工作的时间所占的比例,通常用百分比表示,例如 99.9%。
实际中,uptime 是通过从外部定期检查服务来测量的:发一个 HTTP 请求、建立一个 TCP 连接,或做一次 DNS 查询。每次检查要么通过、要么失败,uptime 就是通过的时间除以整个周期。
这个数字取决于“正常”是怎么定义的。页面能打开但显示错误,或者要 20 秒才响应,如果检查只看状态码,仍然可能算通过。关键词检查和响应时间上限能让这个数字更接近用户的真实体验。
它还取决于统计周期和排除项。按月统计比按年统计掩盖的问题更少,很多合同还会把提前公告的维护时间排除在外。
速览
uptime = 正常时间 ÷ 周期长度 × 100%
在 OpenUptime 中
OpenUptime 记录每一次检查,按监控显示 uptime,并在状态页上显示 90 天的条形图。监控在连续失败达到设定次数(默认 3 次)后才会判定为宕机,所以偶尔丢一个请求不会被算作故障。
常见问题
100% 的 uptime 可能吗?
在很短的时间里可以;作为承诺则不行。硬件、网络和发布都会偶尔出问题,所以目标通常写成几个 9。
uptime 应该多久检查一次?
检查间隔要比允许的停机时间小得多,常见的经验是不超过预算的十分之一。对于按月计算的 99.9%,就是每 4 分钟或更短检查一次。