Course contentsShow
← Cloud and Infrastructure
Lesson 635 of 2,98912. Monitoring FoundationsFree lesson

Percentiles vs Averages

Why p50, p95, and p99 percentiles provide better insight than averages for latency and performance.

Percentiles vs Averages

You'll learn why percentiles reveal what averages hide when measuring latency and performance.

When monitoring system performance, averages can be dangerously misleading. Imagine a restaurant where 99 customers wait 1 minute for food, but 1 customer waits 100 minutes. The average wait time is ~2 minutes—sounds great! But that one customer had a terrible experience that the average completely masks.

The Problem with Averages

Averages treat all values equally, which means outliers (extremely high or low values) get smoothed out. In cloud systems, this hides the truth: a few slow requests can indicate serious problems, even when most requests are fast.

If your API has 1000 requests where 990 complete in 50ms and 10 take 5000ms, the average is ~100ms. Leadership might think performance is acceptable, but 1% of your users are suffering 100x worse experience.

Why Percentiles Matter

Percentiles tell you: "X% of requests completed in Y milliseconds or less."

  • p50 (median): Half of requests were faster, half slower
  • p95: 95% of requests completed within this time; only 5% were slower
  • p99: 99% completed within this time; only the worst 1% exceeded it

These metrics expose the user experience at different scales. p99 reveals what your unlucky users encounter, while p50 shows typical performance.

Real-World Impact

If your p50 latency is 50ms but p99 is 2000ms, you know that 1% of users face 40x slower responses. That's actionable data for optimization, capacity planning, or identifying bottlenecks.

Key Takeaway: Use percentiles (p50, p95, p99) instead of averages to understand real user experience and catch performance problems that affect even small percentages of requests.