P50, P95, P99, and the Average: What Latency Numbers Actually Tell You
Average response time hides the worst user experiences. P99 can run 100× slower than P50 on the same dataset. What P50, P95, and P99 mean, why they matter, and how to read them together.
On this page
For most of computing history, the answer to “how fast is our system?” was a single number: the average response time. It was easy to calculate, easy to put on a dashboard, and easy to report to stakeholders. There was just one problem - it kept lying.
Teams would look at a perfectly healthy average and miss the fact that a meaningful slice of their users were waiting ten times longer than everyone else. The average didn’t hide this maliciously. It just wasn’t designed for the question being asked.
Percentiles were the answer. They were borrowed from statistics - where they’d been used for decades in medicine, education, and economics to describe how individuals rank within a group - and applied to system performance monitoring as web-scale software made the limits of the average impossible to ignore.1
Where the Average Breaks Down
Before getting into percentiles, it helps to understand exactly why the average fails - because the failure isn’t obvious until you see it spelled out.
Imagine a coffee shop. On a typical morning they serve 100 customers. Ninety-five of them get their coffee in 2 minutes. Five customers hit a bad moment - the machine jammed, the barista had to switch cups - and waited 22 minutes each.
Average wait time:
Three minutes sounds reasonable. But five customers waited 22 minutes. With the same distribution across 100,000 web requests, 5,000 requests would be slow. To find out how many people that affected, you’d need to know which requests belonged to the same user.
This is the core problem. The average adds everything together and divides. It cannot distinguish between “everyone had a consistent experience” and “most people were fine but a few were miserable.” Those two situations are completely different in practice - they have different causes, different fixes, and different impacts on users - but the average reports the same number.
What a Percentile Actually Is
A percentile tells you where a measurement sits in an ordered sample. I’ll use the nearest-rank convention here: sort the requests from fastest to slowest, multiply the percentile by the number of requests, and round the rank up. Other conventions interpolate between observations. Monitoring tools can also estimate percentiles from histogram buckets.
Start with a concrete picture. Imagine collecting 1,000 response time measurements from your server over five minutes, then lining them up from fastest to slowest:
- P50 is the duration at position 500. At least 500 requests finished in that time or less.
- P95 is the duration at position 950. At most 50 requests took longer.
- P99 is the duration at position 990. At most 10 requests took longer.
Two requests can have the same duration. If positions 990 through 1,000 all took one second, P99 is one second and no request took longer.
The Four Numbers
Average (Mean)
The average is the sum of the request durations divided by the request count. It tells you how much time a request took on average across the sample. It doesn’t tell you how that time was distributed.
Its weakness: a small number of very slow requests can move the average noticeably, but when that number is small enough, the movement is invisible.
989 requests at 10 ms, 11 requests at 1,000 ms:
Rounded to one decimal place, the mean is 20.9 ms. Yet 11 of the 1,000 requests took a full second. That’s 1.1% of the requests, each taking 100 times as long as a 10 ms request.
The same dataset, four different answers:
All four numbers describe the exact same dataset. Average, P50, and P95 all sit between 10–21ms — nothing looks wrong. Then P99 jumps to 1,000ms. That jump is what the average, P50, and P95 were all hiding.
P50 - The Typical Experience
P50 is the 50th percentile. It marks the middle of the ordered sample. With an even number of observations, the nearest-rank convention picks the lower middle observation; another common median convention averages the middle pair.
If P50 is 12 ms, at least half the observed requests completed in 12 ms or less under nearest rank. They could finish anywhere below that threshold. You need more of the distribution to say how tightly they cluster around 12 ms.
P50 is your baseline. It describes normal. When P50 starts rising, your typical behavior is getting worse. Two systems can share an identical P50 while one of them has a P99 ten times higher — P50 alone tells you nothing about the slow end.
P95 - The Unlucky Minority
P95 marks the duration at the 95th-percentile rank. A slower tail can be worth investigating during a traffic spike or when a database is under load.
At 1,000 requests per second, the slowest 5% of a one-second sample contains 50 requests. Ties can put some of those requests right on the P95 threshold.
P95 is often where SLAs (service-level agreements) are defined. “99% of requests under 200ms” is a P99 commitment. “95% of requests under 100ms” is a P95 commitment. These numbers exist because the companies writing them knew an average target was meaningless.
P99 - The Slow End of the Sample
P99 marks a point near the slow end of the distribution. The slowest request can still take much longer than P99.
At 10,000 requests per second, the slowest 1% of a one-second sample contains 100 requests. A single user can make many of those requests. To measure a user’s wait, measure the whole interaction.
P99 is where the hard-to-reproduce bugs live. Cold caches, garbage collection pauses, slow network routes, lock contention on a shared resource - these don’t happen on every request, but they happen regularly enough to show up at the 99th percentile. A high P99 usually means your system has unpredictable behavior on some slice of requests, and that slice is worth finding.
At 100,000 requests per second, the slowest 0.1% of a one-second sample contains 100 requests, and the slowest 0.01% contains 10. P99.9 and P99.99 describe those higher ranks. Their usefulness depends on having enough measurements in your reporting window.
Why the Industry Moved to Percentiles
The shift from average-based to percentile-based monitoring happened gradually through the 2000s and accelerated with the growth of web-scale systems at companies like Amazon and Google.
The turning point was recognizing that at large scale, tail latency - the slow end of the distribution - stops being an edge case and starts being a daily operational reality. In 2013, Google engineers Jeffrey Dean and Luiz André Barroso published a paper called The Tail at Scale that made this concrete: in a system where a single user request fans out across hundreds of backend services, the probability that at least one of those services returns a slow response approaches certainty.2
This meant optimizing the average was optimizing the wrong thing. The slow outliers - the requests that became the P99 - were the ones actually shaping user experience at scale. Percentiles gave teams a language for talking about and measuring those outliers directly.
Reading Them Together
The real insight comes from comparing the numbers, not reading any one of them in isolation.
| What you observe | What it likely means |
|---|---|
| P50 = 12ms, P99 = 15ms | Tight gap - consistent behavior, the system responds predictably regardless of conditions |
| P50 = 12ms, P99 = 800ms | Wide gap - something is causing occasional severe slowdowns: GC pauses, cache misses, lock contention |
| P50 = 200ms, P99 = 210ms | Consistently slow but predictable - the bottleneck is structural (a slow query, a synchronous call) not random |
| P50 rising, P99 stable | Typical behavior is degrading - increased load or a gradual regression in the common path |
| P99 rising, P50 stable | Outliers are getting worse while the common case stays fine - something is randomly spiking |
The gap between P50 and P99 is often the most informative single signal. A tight gap means the system is stable. A wide gap means something is introducing variance, and variance is what makes a system feel unreliable even when the average says otherwise.
In practice, the P50-to-P99 gap is where regressions often surface first. A deployment that looks clean on average dashboards can show up as a quietly widening gap a day later — noticeable only once you’re watching the right number.
In most modern stacks, making these numbers visible is already handled for you.
Are These Numbers Given, or Do You Have to Set Them Up?
In modern monitoring tools, percentiles are built in - but only if you’re feeding them the right kind of data. Tools like Prometheus, Datadog, Grafana, New Relic, and Azure Monitor can all compute P50, P95, and P99 out of the box. What they need from your application is not raw logs, but metrics - specifically a type of metric called a histogram.3
A histogram works by recording every measurement into pre-defined buckets (0-10ms, 10-50ms, 50-200ms, and so on) and counting how many requests land in each. The monitoring tool uses those counts to estimate percentiles without storing every individual data point. This is efficient enough to run in production at high traffic.
In .NET, ASP.NET Core automatically records request duration as a histogram - this existed earlier via EventCounters, but in .NET 8 it was overhauled to use the System.Diagnostics.Metrics API and aligned with OpenTelemetry conventions under the metric name http.server.request.duration.4 If you’re on .NET 8+ and exporting metrics to Prometheus or Azure Monitor, you get percentiles without writing a single extra line of code.
For custom operations - a specific method, a database call, a third-party API - you record the duration yourself:
// Record a custom measurement - the monitoring tool handles the percentile math
private static readonly Histogram<double> _checkoutDuration =
Meter.CreateHistogram<double>("checkout.duration", unit: "ms");
var sw = Stopwatch.StartNew();
await ProcessCheckoutAsync(order);
_checkoutDuration.Record(sw.Elapsed.TotalMilliseconds);
What about logs? You can calculate percentiles from logs, and some teams do. The downside is cost and latency: logs at high traffic volumes are expensive to store and query, and log-based percentile queries are slow. Logs are better suited for understanding why a specific slow request happened, not for tracking the P99 trend over time.
What about traces? Distributed tracing (via OpenTelemetry, Jaeger, or similar) gives you a detailed picture of what happened inside a single request. It’s the right tool for diagnosing a spike once you’ve spotted it - not for measuring the spike in the first place. Percentiles come from aggregating across thousands of requests; traces show you one at a time.
| Data source | Good for percentiles? | Best used for |
|---|---|---|
| Metrics (histograms) | Yes - designed for this | Dashboards, alerts, SLO tracking |
| Logs | Possible, but expensive | Debugging specific slow requests |
| Traces | No - single-request view | Root cause analysis after a spike |
Where to Start When Something Looks Wrong
P99 is high? Something is causing spikes - it happens rarely but badly when it does. Look for things that don’t happen on every request: cache misses, garbage collection, slow external calls, locks. Hot paths are the most common source — code that runs on every request, where small repeated inefficiencies compound into exactly the kind of tail spikes P99 reveals.
P99 is fine but P50 is slow? The problem is consistent, not random. Something slow is on every request’s path: a database query that always takes 80ms, a synchronous call that blocks every time, middleware that does unnecessary work on each request.
Both look fine but the average is high? You likely have a very small number of extreme outliers - requests taking seconds rather than milliseconds. These may be bugs, timeouts, or edge cases in rarely-used code paths. Worth investigating, but less urgent than the above.
The average is the last number to act on, not the first. Fixing it directly often means optimizing the cases that are already fast while ignoring the ones that need attention.
Start with P99. It’s the number that works hardest to stay invisible, and in my experience the one that most reliably predicts what users are about to complain about.
Footnotes
-
Schwartz, B. et al. (2012). High Performance MySQL, 3rd ed. O’Reilly — on using percentiles rather than averages for server latency measurement. ↩
-
Dean, J., & Barroso, L. A. (2013). The tail at scale. Communications of the ACM, 56(2), 74–80. https://dl.acm.org/doi/10.1145/2408776.2408794 ↩
-
Prometheus documentation — Histogram metric type. https://prometheus.io/docs/concepts/metric_types/#histogram ↩
-
Microsoft — ASP.NET Core metrics,
http.server.request.duration. https://learn.microsoft.com/aspnet/core/log-mon/metrics/metrics ↩