Measuring a System: Latency, Throughput & Availability
Definition
Latency
- In plain English
- Latency is how long one request takes from start to finish.
- Think of it like
- It is like the time from ordering a coffee to holding it in your hand.
Throughput
- In plain English
- Throughput is how many requests a system finishes each second.
- Think of it like
- It is like how many coffees a café hands out per hour.
Availability
- In plain English
- Availability is the percentage of time a system works when people try to use it.
- Think of it like
- It is like the share of opening hours a shop's door is actually unlocked.
Why it exists
At 8 am, customers wait three seconds to order coffee. “It feels slow” gives you no clear test for a fix.
Measure before and after a change. An average alone hides the people who wait longest.
How it works
Percentile
- In plain English
- A percentile such as p99 is the time that 99 out of 100 requests finish within.
- Think of it like
- Like saying 99 of 100 buses arrive within five minutes of schedule.
SLO
- In plain English
- An SLO is a target you set for a measurement, such as 99% of requests finishing within 300 milliseconds.
- Think of it like
- Like a pizza shop promising delivery within 30 minutes.
| Measurement | Motorway comparison | What changes it |
|---|---|---|
| Latency | Travel time for one car | A faster journey |
| Throughput | Cars arriving each hour | More lanes allow more cars without a faster journey |
The phone reaches the server in 40 ms. Server work takes 15 ms, the database takes 60 ms, and returning takes 40 ms.
- Sort 100 request times from fastest to slowest.
- 98 requests take 100 ms each; two take 3,000 ms each.
- Average = (98 × 100 + 2 × 3,000) ÷ 100 = 158 ms.
- The 99th sorted request takes 3,000 ms, so p99 is 3 seconds.
| Availability | Downtime per 365-day year |
|---|---|
| 99% | 3.65 days |
| 99.9% | 8.76 hours, about 8.8 hours |
| 99.99% | 52.56 minutes, about 53 minutes |
| 99.999% | 5.256 minutes, about 5 minutes |
Examples
Catch the finishing wave
Chip readers record up to 2,000 runners a minute. Runners accept results appearing one minute later.
You need to record every finish before the next wave arrives. Here, throughput is the hard part.
Chip mats send finish records to the timing server, which publishes the results page.
The insight
Choose the measurement your users actually feel.
Budget the downtime
The call-taking system targets 99.99% availability. During an outage, calls go to a slower backup centre.
That target allows about 53 minutes down across a 365-day year. A short outage still delays urgent calls.
- Count every outage toward the annual total.
- Choose a target that reflects the harm from unavailable service.
The insight
The cost of an outage decides how many nines you need.
See the slowest orders
The order service averages 120 ms. At the 8 am rush, p99 reaches 2.4 seconds.
About one customer in a hundred waits at least 2.4 seconds. Here, p50 describes the middle request, and p95 covers 95 out of 100.
p50 90 ms
p95 400 ms
p99 2400 ms
avg 120 msThe insight
Percentiles reveal the users that averages hide.
Trade-offs
Pros
- Give the team a clear goal.
- Catch slowdowns early.
- Prioritise work using measurements.
Cons
- Higher availability targets usually cost more.
- Measurement needs tools and upkeep.
Use when
- Set targets for services people depend on.
- Compare performance before and after changes.
Avoid when
- Avoid five nines for a tool unused at night.
- Avoid targets unrelated to user needs.
Quick check
Takeaways
- Latency measures one request’s time; throughput measures requests finished per second.
- Watch percentiles alongside averages.
- Each extra nine of availability usually demands more work.