In the world of database performance and system monitoring, P90 and P95 are terms used to describe specific statistical percentiles. These figures provide insights into the distribution of latency values within a given data set.
P90 (or the 90th percentile) represents the value below which 90% of the observations may be found. For example, if the P90 latency of your database queries is 200 milliseconds, it means that 90% of your queries are completing in 200 milliseconds or less.
Similarly, P95 (or the 95th percentile) is the value below which 95% of the observations fall. If the P95 latency is 250 milliseconds, it indicates that 95% of your queries are completed within this time frame.
The higher the percentile, the closer you are to the maximum value in your distribution. Therefore, P95 will always be equal to or greater than P90. The difference between these two can help understand the consistency of your system's performance. For instance, if P90 is 200 ms and P95 is 300 ms, it could suggest that there's a subset of queries experiencing significantly higher latencies.
Here's an illustrative Python code using numpy to compute these percentiles:
The choice of percentile to consider depends on your specific requirements. If you want a general overview of performance for most users, P90 might be sufficient. However, if you're more interested in understanding the experience of slower queries or worst-case scenarios, higher percentiles like P95 or P99 could be more informative.