P95 latency, also known as the 95th percentile of latency, is a statistical measure used in computer network performance analysis. It essentially indicates that 95% of requests to a system were served faster than this value, while 5% took longer.
In practical terms, it's often used to identify the experience of outliers in system performance. While average or median latencies can provide an overall view of system performance, they may obscure the experience of users who encounter much slower response times. P95, and other percentile measures like P99, help to highlight these potentially problematic scenarios.
Here's a simple example with Python using the
In this case, we see that 95% of our latencies are below or equal to 95ms, meaning that only 5% of requests experienced latencies higher than 95ms.
With real latency data from a system, you can use similar calculations to identify your P95 latency, which can then be used to optimize for better performance, especially focusing on those worst-case scenarios.