Troubleshooting guide
How to calculate uptime percentage (with examples)
Uptime is simple arithmetic. The hard part is agreeing on what counts as down, and the difference between those definitions can decide an SLA.
3 min read11 sectionsUpdated
On this page
The formula
Uptime % = (total minutes − downtime minutes) / total minutes × 100
For a 30-day month there are 43,200 minutes. With 30 minutes of downtime: (43,200 − 30) / 43,200 × 100 = 99.93 percent. Use the uptime calculator to work out any target or period.
Calculate it from your data
From a list of incident durations, or from check results, it is a single line.
# From incident durations in minutes, one per line
awk -v total=43200 '{d+=$1} END {printf "downtime %d min, uptime %.3f%%\n", d, (total-d)/total*100}' incidents.txt
-- From check results in SQL
SELECT 100.0 * count(*) FILTER (WHERE status = 'up') / count(*) AS uptime_pct
FROM checks WHERE at >= date_trunc('month', now());Decide the definitions
Write down: what counts as down (total outage, or error rate above a level?), who measures, from which regions, whether planned maintenance is excluded, and over what window. Detection also matters: with one-minute checks, a real outage may be measured up to a minute short or long. Keep the raw incident records as well as the final percentage, because customers and auditors may ask how the number was reached. Round down when reporting, never up.
Partial outages and composite services
If one of four regions fails for an hour, is that 60 minutes down, 15 minutes weighted, or nothing? A weighted approach counts the affected share of users or requests, and it is usually fairest. For dependencies in series the availabilities multiply: three services at 99.9 percent give about 99.7 percent together, so a chain is always less available than its weakest part. Request-based availability, which is successful requests divided by total requests, avoids some of this, and is what most SLOs use because it reflects real user experience.
Measure it automatically
An external uptime monitor gives a record independent of your own systems, and SLOs turn the number into a budget you can act on. A public status page shares it with customers.
Check it now, free
- Downtime cost calculator: What an outage costs per minute, hour and year.
Related reading
- What are SLA service credits?: Service credits explained: what an SLA owes when uptime is missed, typical credit tiers, how to calculate them, exclusions, and how to report them to customers.
- How to monitor website uptime: Set up website uptime monitoring that catches real outages: which URLs to check, intervals, regions, content assertions, alert routing and a status page.
- A Freshping alternative: VitalRix vs Freshping: Looking for a Freshping alternative? Compare uptime checks, status pages, alerts and on-call in VitalRix with Freshping, and how to move your monitors.
- A HetrixTools alternative: VitalRix vs HetrixTools: VitalRix vs HetrixTools: uptime and server monitoring, blacklist checks, status pages and alerts compared, plus APM, logs and on-call in one platform.
- Pingdom vs UptimeRobot: Pingdom vs UptimeRobot compared: check types, intervals, alerts, status pages, real user monitoring and free plans, and which one fits your website.
- What is URL monitoring?: URL monitoring explained: scheduled checks of a URL for status code, content, response time, redirects and SSL, with sensible settings.
Watch your own site and services with VitalRix
Uptime checks, APM, logs, real-user monitoring, alerts and status pages in one place. Every product has a free tier and no credit card is needed.