Question: What is p95 latency?
Answer
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 numpy
library:
import numpy as np
# let's say these are latencies in milliseconds
latencies = [10, 20, 30, 40, 50, 60, 70, 80, 90, 100]
p95_latency = np.percentile(latencies, 95)
print(p95_latency) # 95.0
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.
Was this content helpful?
Other Common Database Performance Questions (and Answers)
- What is the difference between database latency and throughput?
- What is database read latency and how can it be reduced?
- How can you calculate p99 latency?
- How can one check database latency?
- What causes latency in database replication and how can it be minimized?
- How can you reduce database write latency?
- How can you calculate the P90 latency?
- How can you calculate the p95 latency in database performance monitoring?
- How can you calculate the p50 latency?
- What is database latency?
- What are the causes and solutions for latency in database transactions?
- What is the difference between p50 and p95 latency in database performance metrics?
Free System Design on AWS E-Book
Download this early release of O'Reilly's latest cloud infrastructure e-book: System Design on AWS.
Switch & save up to 80%
Dragonfly is fully compatible with the Redis ecosystem and requires no code changes to implement. Instantly experience up to a 25X boost in performance and 80% reduction in cost