This content has been automatically translated from Ukrainian.
The 90th percentile is a metric commonly found in analytics, statistics, server monitoring, and performance testing. But what does it actually mean?
Imagine we measured the server response time for 1000 requests and sorted all the results from fastest to slowest.
90th percentile (P90) is the value below or at which 90% of all measurements fall.
For example, if:
P90 latency = 500 ms
this means that 90% of requests were completed in 500 ms or faster, and approximately 10% were slower.
How is the percentile different from the average?
Suppose 9 requests were completed in 100 ms, and one took 10 seconds.
The average would be:
(9 × 100 + 10 000) / 10 = 1090 ms
And it might seem that the system, on average, responds in over a second.
But this does not accurately reflect the typical user experience: most requests were actually completed in 100 ms.
The percentile allows for a better view of the distribution of results.
P50, P90, P95, and P99
Commonly encountered are:
- P50 - median. 50% of values are below this point.
- P90 - 90% of values are below this point.
- P95 - 95% of values are below this point.
- P99 - 99% of values are below this point.
For example: This means that half of the requests were completed in 120 ms or faster, 90% in 300 ms or faster, 95% in 450 ms or faster, and 99% in 1.2 seconds or faster.
Why is this important?
Percentiles are particularly useful for performance testing and monitoring.
The average can hide slow requests. For instance, the average latency might be 200 ms, but P99 could be 5 seconds. Then, for a small portion of users, the system operates very slowly.
Therefore, in production, people often look not only at average latency but also at P90/P95/P99.
And there is an important point here:
P90 = not "90% of requests take exactly this much time."
If P90 equals 500 ms, it means that 90% of requests take no more than 500 ms, not that each of these requests takes exactly 500 ms.
In simpler terms:
The 90th percentile shows the threshold below which 90% of measurements fall.
And the remaining 10% is the "tail" of the distribution, where the slowest requests, database issues, load spikes, or other performance problems may be hidden.
Like it?React
🧵
This post doesn't have any additions from the author yet.