API latency learning path Level 1 This level ยท 1 of 2
Easy java backend

Why percentiles and not the average?

The 30 second answer

Latency is skewed. A few very slow requests barely move the average, but real users hit them, and one page often makes many calls, so most users see the tail at some point. Percentiles like p95 and p99 show what the slowest users actually experience. An average can look healthy while a meaningful share of requests are painfully slow.

Could you say this in an interview?

Latency is skewed. A few very slow requests barely move the average, but real users hit them, and one page often makes many calls, so most users see the tail. So I look at p95 and p99.

# 99 requests at 50ms, 1 request at 5s
# average โ‰ˆ 100ms  (looks fine)
# p99 = 5s         (what a user of that request actually felt)
Sources (2)
  1. Google SRE book: Service Level Objectives (why percentiles)sre.google
  2. Gil Tene: How NOT to Measure Latencyinfoq.com
Previous
Next