tools / latency-percentiles

Latency Percentile Calculator

Paste latency samples to get p50, p90, p99 and p99.9 with a histogram. Nearest-rank method, runs in your browser.

p99

Key facts

pX meansX% of requests were at or below this value
Method usedNearest rank: sort, take the value at position ⌈q·n⌉
Samples neededAbout 10 / (1 − q): p99 ≈ 1,000 samples, p99.9 ≈ 10,000
NeverAverage percentiles across hosts or time windows — merge the histograms instead
Mean vs medianLatency is right-skewed, so the mean usually sits above p50

Worked example

Ten samples in ms, sorted:

8  9  9  10  10  11  12  14  20  95

p50 → position ⌈0.5 × 10⌉ = 5  → 10 ms
p90 → position ⌈0.9 × 10⌉ = 9  → 20 ms
p99 → position ⌈0.99 × 10⌉ = 10 → 95 ms
mean = 198 / 10                → 19.8 ms

One slow call drags the mean to double the median, and with ten samples p99 is just the maximum. You need far more data before p99 means anything.

Reading the histogram

A single tight hump is healthy. A second hump further right usually means a second path: cache misses, retries, a slow dependency or garbage-collection pauses. A long flat tail points to queueing.

FAQs

Why can't I average p99 across servers?

Percentiles don't add. Two servers with p99 of 50 ms and 500 ms don't have a combined p99 of 275 ms. Combine the raw samples or histograms, then compute.

Which percentiles should I track?

p50 for the typical experience, p99 for the tail, and p99.9 for high-traffic or fan-out services, where the tail is hit often.

Why do load-test percentiles look too good?

Many load generators wait for slow replies before sending more, so they miss the stall. That is coordinated omission; drive load at a fixed rate instead.

Sources

  1. HdrHistogram — high dynamic range histogram project
  2. Dean, J. & Barroso, L. A. — The Tail at Scale (Communications of the ACM, 2013)

Related