AlgoViz

Defining high availability

easy 25 min

Availability is the share of time, or of requests, that a system works for its users.

See it run

What a nine means in minutes, how it is measured, why parts multiply, and how a budget gets spent.

Operations

Climb the nines

From two nines to six: one row at a time, with the downtime it leaves in a year and in a 30-day month.

Step 1 of 5

Two nines

TargetDown per yearDown per month
2 nines99%3.65 days7.2 hours
3 nines
4 nines
5 nines
6 nines

1% of 365 days = 3.65 days

99% sounds high, but 1% of a year is 3.65 days. Users would call it unreliable.

Step 1: Two nines

def allowed_minutes(target, days):    total = days * 24 * 60    return total * (100 - target) / 100
Period
Year, month
You learn
Minutes allowed
Each extra nine
10x less downtime

Learn two numbers: 99.9% is 43 minutes a month. Multiply or divide by ten for the neighbours.

In the real world

The same defining high availability doing real jobs. Pick one and step through it.

The same crash on the busiest day of the year, without and with a spare.

Step 1 of 4

Without a spare

Our systemShoppersLoad balancerServer 1

One server

One server sells everything. It is the busiest hour.

Step 1: Without a spare

Common mistakes

The bugs interviewers watch for, with the fix beside each.

  • A target without a period

    major

    99.9% of a day is 86 seconds, of a year 8.76 hours. Without the period the number cannot be checked.

    Wrong
    target = "99.9%"
    Right
    target = ("99.9%", "good requests", "30 days")
  • Averaging the chain

    critical

    Parts that are all needed multiply. The average hides that the chain is worse than its worst part.

    Wrong
    total = sum(parts) / len(parts)
    Right
    total = 1.0for p in parts:    total *= p
  • SLO looser than the SLA

    critical

    You would break the contract before your own alarm rings.

    Wrong
    sla = 99.9slo = 99.5
    Right
    sla = 99.9slo = 99.95   # stricter
  • Counting one outage twice

    minor

    Two alerts for the same minutes make the outage look twice as long.

    Wrong
    down = sum(b - a for a, b in alerts)
    Right
    down = sum(b - a for a, b in merge_overlaps(alerts))

Interview tips

  • How to explain it

    • Good time over total time, or good requests over all.
    • Count the nines, name the period.
    • Say what the number forces, such as automatic failover.
  • Memory trick: NINES

    • Number of nines, Inverse to downtime.
    • Next nine is ten times less, and Expensive.
    • SLA is the promise.
  • Raise it by

    • Recovering faster: failover, rollback, runbooks.
    • Failing less: tests, spares, capacity.
    • Making dependencies soft.
  • Watch out for

    • Dependencies with fewer nines than your target.
    • Metrics from inside a server that may be dead.
    • Planned maintenance that nobody counts.