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?
Help us improve by giving us your feedback.
Other Common Database Performance Questions (and Answers)
- What is database read latency and how can it be reduced?
- What is the difference between P50 and P90 latency in database performance?
- What is the difference between p95 and p99 latency in performance metrics?
- What are the key performance indicators for database performance management?
- What is the performance difference between a database and JSON?
- What is the difference between read-through and write-through cache?
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