SteelReed

Search

Search posts, questions…

System DesignQuestion 14 / 26

Junior

Why measure latency with p99 instead of the average?

Short answer

The average hides the slow requests: 99 requests at 10 ms and 1 at 5 s average ~60 ms, which looks fine. p99 is the threshold 99% of requests beat: it reflects the experience of the worst-served users.

1 − 0.99¹⁰⁰Page calls 100 servicesin parallelEach service1% slow calls≈ 63% of page loadshit at least 1 slowService p99 ≈ page p50

3 points to say:

  1. Latency has a long tail (GC pauses, lock contention, retries); the average doesn't say how many people wait.
  2. Fan-out amplifies the tail: each service's p99 becomes ~the page's p50, so large systems also watch p99.9.
  3. Measure with histograms, never average percentiles across instances; an SLO always states throughput ("p99 < 300 ms at 1,000 RPS").

Keep reading the deep dive

Create a free account to read the full explanation and follow-up questions, mark questions as studied and review them on a schedule.