What are P90, P95, P99 Latency Percentiles? Understanding Performance Metrics
- P90, P95, P99 Latency are performance metrics and are one of the ways to measure a system's response time. It is used to measure the performance of the system and analyze the response time of the system.
- P90, P95, and P99 Latency represent response times of 90%, 95%, and 99%, respectively.
- P90: means 90% of requests were processed within this time.
- P95: means 95% of requests were processed within this time.
- P99: means 99% of requests were processed within this time.
- It may be difficult to understand if you only read the explanation above, so let’s understand through the example below.
Latency | Number of requests | Sum of requests |
---|---|---|
100ms | 3 | 3 |
200ms | 5 | 8 |
300ms | 10 | 18 |
400ms | 30 | 48 |
500ms | 20 | 68 |
600ms | 15 | 83 |
700ms | 10 | 93 |
800ms | 4 | 97 |
2000ms | 2 | 99 |
10000ms | 1 | 100 |
*The above data represents response time for 100 requests.
- Let’s calculate P90, P95, and P99.
- P90: Indicates the time when 90% of requests were processed. Therefore, we need to find the response time of 100 * 0.9 = 90th request. The response time for the 90th request is 700ms.
- P95: Indicates the time when 95% of requests were processed. Therefore, we need to find the response time of 100 * 0.95 = 95th request. The response time for the 95th request is 800ms.
- P99: Indicates the time when 99% of requests were processed. Therefore, we need to find the response time of 100 * 0.99 = 99th request. The response time for the 99th request is 2000ms.
- Therefore, P90, P95, and P99 in the above data are 700ms, 800ms, and 2000ms, respectively.
- The slowest response time here is 10000ms. This represents the time when 100% of requests were processed.
- Most request rates are between 300ms and 800ms, but you may notice some requests can take up to 10000ms.
- If the values of special prime numbers are very large, the average value becomes very high, so it may not be appropriate to measure performance only by the average value.
- You can consider the average annual salary as an example in the case above. If a few executives have very high salaries, the average salary may be high, but most employees may have salaries below average.
- Because the average can react sensitively to outliers, apart from measuring latency with the average, Latency is measured using P90, P95, and P99.