System Design Academy

Saving…

Lesson 1 of 8 in Module 20 of 54 lessons complete

Measuring a System: Latency, Throughput & Availability

Module 2, lesson 1Concept10 min

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.
MeasurementMotorway comparisonWhat changes it
LatencyTravel time for one carA faster journey
ThroughputCars arriving each hourMore 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.

Total request time is approximately 155 ms.

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.
AvailabilityDowntime 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.

Throughput is the hard part at the finish line.

Chip mats send finish records to the timing server, which publishes the results page.

The insight

Choose the measurement your users actually feel.

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

Average latency is 100 ms but p99 is 3 s. What does this tell you?
A service promises 99.9% availability. Roughly how much downtime is allowed per year?

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.

Try the quick check above whenever you feel ready.

Previous: Choosing a Protocol