Uptime is measured from the outside: a monitor sends a request on a schedule and records whether the answer was right. The percentage is the working time divided by the measured time, so the result depends on how often you check and on what counts as working: any answer, a specific status code, or a page that contains the right text.
A server can be running while the service is down for its users. A broken database connection, an expired certificate or a DNS mistake leaves the machine up and the website unusable. That is why uptime monitoring checks what users reach, not the host’s own uptime counter, which only says how long it has run since the last restart.
Dashboards and agreements usually report uptime per calendar month, which is also the period an SLA’s service credits are calculated over. The nines show how little downtime the higher targets allow.
Formula
Uptime % = (measured time − downtime) ÷ measured time × 100
Example:
An average month has 2,629,800 seconds (365.25 days ÷ 12). 43 minutes and 49 seconds of downtime in it leaves 99.9% uptime.