Question: What is P90 latency in database performance?
Answer
"P90 latency," also sometimes referred to as the 90th percentile of latency, is a statistical measure used to understand the performance characteristics of a system, such as a database or a network. It provides a threshold under which 90% of the observed latency measurements fall.
In the context of a database, P90 latency tells you that 90% of your database queries are executed within this specified latency. For example, if the P90 latency for a given set of database operations is 200 milliseconds, it means that 90% of these operations have completed within 200 milliseconds.
P90 latency is particularly useful because it can help isolate and understand outliers. While average (or mean) latency can give you a general sense of how your system performs, it may not fully capture the experience of users if there are occasional instances of high latency. Using P90 (or other percentiles like P95 or P99) can give a much better understanding of these outliers, thus allowing you to optimize your database more effectively.
Here's a simple Python example of how to calculate P90 latency from a list of latency measurements:
import numpy as np # let's assume latencies is a list of your measured latencies latencies = [...] # calculate P90 p90_latency = np.percentile(latencies, 90)
In this example, np.percentile
is a function from Python's NumPy library that computes the nth percentile of a list of values.
In conclusion, P90 latency is a valuable metric when assessing database performance as it provides insights into the behavior of the majority of transactions, mitigating the impact of extreme outliers that could skew an average latency calculation.
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