Glossary · Performance
Percentile latency
Also called: p50, p90, p95, p99
Definition
A response-time measure such as p95 or p99 showing the time within which that share of requests finished, which exposes the slow tail averages hide.
Percentile latency describes response times by rank instead of by average. The p95 is the value that 95% of requests were at or below; only the slowest 5% took longer. p50 is the median, the typical experience. p99 and p99.9 describe the tail: the slowest requests, which are often the ones users notice and complain about.
Why percentiles beat averages
Take 100 requests: 90 take 100 ms and 10 take 2,000 ms.
| Statistic | Value |
|---|---|
| Average | 290 ms |
| p50 (median) | 100 ms |
| p95 | 2,000 ms |
| p99 | 2,000 ms |
The average of 290 ms describes no request that actually happened. It looks acceptable, yet one user in ten waited two seconds. The percentiles show both facts: most requests are fast, and the tail is very slow. Averages are also pulled around by a few extreme outliers, while the median is not.
The tail matters more than it seems. A single page load often makes many backend calls, and a user session involves many page loads, so a large share of users will hit at least one p99-slow request during a visit.
Using percentiles in tests
Performance targets and gates should be written as percentiles. In k6:
export const options = {
thresholds: {
http_req_duration: ['p(50)<200', 'p(95)<500', 'p(99)<1500'],
},
};
Report several percentiles together (p50, p95, p99, max), alongside throughput and error rate, because each tells a different part of the story.
Common mistakes
- Averaging percentiles. The mean of ten servers’ p95 values is not the overall p95. Percentiles must be computed from the combined raw data or from mergeable histograms.
- Too few samples. A p99 from 200 requests rests on two data points. Run long enough to have meaningful counts in the tail.
- Ignoring errors. A request that fails fast in 5 ms can make latency look better. Always read latency next to the error rate.
- Coordinated omission. A load tool that waits for each slow response before sending the next request quietly sends fewer requests during slowdowns, which understates tail latency. Arrival-rate (open model) load generation reduces this.