Start free trial
Start free trial Log in

14-day free trial. No credit card.

p95 vs p99 Latency, Explained

  • Glossary
  • 4 minute read

What's the difference between p95 and p99 latency?

p95 latency is the response time below which 95% of requests completed; 5% were slower. p99 means 99% completed faster; 1% were slower. Both are 'percentiles.' The gap between them is your tail latency: a small gap means consistent performance, a big gap means a real user population is suffering.

Updated

Someone asks how fast your app is, and you have to give them a number. The average is the tempting answer, and it's the wrong one, because it describes a user who doesn't exist. p95 and p99 are the numbers that describe what people actually feel, and the gap between them tells you whether your slowest requests are rare bad luck or a real problem with your name on it.

The definitions

Sort every request's duration from fastest to slowest. With N requests, the value at position ceil(X/100 × N), counting from the fastest, is pX (the nearest-rank method). With 1,000 requests, p95 is the 950th value and p99 the 990th.

  • p50 (median): half your requests are faster, half are slower
  • p95: 95% of requests finished under this; 5% were slower
  • p99: 99% of requests finished under this; 1% were slower
  • p99.9: 99.9% of requests finished under this; 1 in 1,000 was slower. Worth tracking on payment, auth and other critical paths

Why averages lie

Take an endpoint where 98% of requests finish in 50ms and 2% take 30 seconds. The average is about 650ms, a number that describes neither group. The fast users never see 650ms; the slow users wait 600 times longer than the fast ones. The p95 is 50ms and the p99 is the full 30 seconds, so the gap between them shows the problem the average blurred.

An average blends the fast and slow requests into a duration nobody actually waited. Percentiles keep the slow requests visible.

The gap is the signal

p95 tells you the story for most users. p99 tells you the story for your most frustrated users. The gap between them tells you how frustrated those users are.

Healthy service
p50:   80ms
p95:  180ms
p99:  240ms
Gap p95 → p99: 60ms  (small, consistent tail)
Service with a bad tail
p50:   85ms
p95:  220ms
p99: 3400ms
Gap p95 → p99: 3180ms  (huge: about 1% of requests hit something broken)

Common causes of a big p95 → p99 gap: database contention on specific rows, cache misses, garbage collection pauses, one slow downstream service affecting only some requests, uncached file reads, or (classic in Laravel) an N+1 query that fires on some pages but not others.

A worked example

Picture a dashboard endpoint that looks fine on the average: 140ms, comfortably inside its target. Its p95 is 190ms. Its p99 is 2.8 seconds.

That gap is the whole story. One in a hundred requests is doing something the other ninety-nine aren't. Pulling up a handful of the slow ones shows it: they all belong to accounts with thousands of records, and one widget loads those records without a limit. For a normal account it returns in 40ms. For the biggest tenants it scans the table.

The average never shows it. The p95 barely does. The p99 makes it impossible to miss, and the individual slow requests behind that p99 name the accounts and the query. That's the workflow worth internalizing: the percentile tells you a tail exists, the slow requests behind it tell you why.

How to pick which to optimize

In typical user-facing web apps:

  • p95: your reliable SLO. Alert when it regresses; make it your latency target.
  • p99: your canary. Watch the gap, not the absolute value. A widening gap is often the first sign of degradation.
  • p99.9: for payment, auth, health-critical paths. Worth the operational work.

How many samples you need

Percentiles need volume before they mean anything. A p99 computed from 200 requests jumps every time one slow request lands. That's noise, not signal. One rough heuristic is to want about 100 requests beyond the percentile, which is 100 divided by (1 − percentile): about 2,000 requests before p95 settles, about 10,000 before p99 does.

In practice that makes percentiles a per-route, per-window measurement. p99 across your whole app over a day is solid. p99 for one rarely-hit admin route over an hour is mostly random. So when a percentile looks alarming, check the sample count behind it before you act on it.

How NightOwl surfaces percentiles

NightOwl stores request duration in microseconds and charts p50, p95, and p99 per route, per query pattern, and per job class. For short time windows the percentiles are exact nearest-rank values computed from the raw rows in your PostgreSQL (percentile_disc, or ORDER BY duration OFFSET ceil(n × 0.95) - 1 LIMIT 1). For wide windows a scan of every raw row timed out on busy apps, so NightOwl reads histogram rollups instead and estimates the percentile with DDSketch, which keeps it within 1% of the true value. Those charts aren't wired to alerts: a NightOwl performance alert fires when a single record (a request, job or query) crosses the duration threshold you set, so a p95 regression alert needs a scheduled query against your PostgreSQL.

See your p95 and p99 per route

NightOwl's requests list shows P95 for every route of your Laravel app, and each route's page adds P99 with filters for the requests at or above either one. Queued jobs get p50, p95 and p99 per class.

No credit card needed.

Frequently asked questions

Anything else, write to support@usenightowl.com

What's the difference between p95 and p99 latency?

p95 means 95% of requests completed faster than this number; 5% were slower. p99 means 99% completed faster; 1% were slower. p99 is always ≥ p95. The gap between them tells you how bad the long tail is: a small gap means consistent performance, a big gap means some users are having a much worse experience than the typical request.

Should I optimize for p95 or p99?

Most user-facing web apps optimize for p95 as the reliable SLO and watch p99 as a canary. If p99 is much larger than p95, something is wrong for a small but real population: database contention, cold caches, one slow downstream service. Ignoring p99 means ignoring your most frustrated users.

Why not just look at the average latency?

Averages hide the tail. An endpoint where 98% of requests finish in 50ms and 2% take 30 seconds has a mean of about 650ms, which misrepresents both groups: the fast requests look slower than they are, and the 30-second ones disappear into the number. Its p99 is the full 30 seconds. Percentiles tell you what your users actually experience.

How many samples do you need for a reliable p99?

There's no fixed number. One rough heuristic is to have about 100 requests beyond the percentile, which works out to 100 divided by (1 − percentile). For p99 that's 100 / 0.01 = 10,000 samples in the window; for p95 it's 100 / 0.05 = 2,000. With far fewer samples p99 is noisy and moves around on individual slow requests.

How do I measure p95 in a Laravel app?

Time every request's duration, store it, and sort to pick the 95th percentile. Don't try to compute this in-request. It's an aggregate. An APM does it automatically. NightOwl stores request duration in microseconds. For short windows it computes an exact nearest-rank p95 from the raw rows (ORDER BY duration OFFSET ceil(n × 0.95) - 1 LIMIT 1); for wide windows it estimates p95 from histogram rollups with DDSketch, within 1% of the true value.

Keep reading

Flat pricing, whatever your traffic does

Every plan starts with a 14-day free trial. No credit card needed.

Hobby
$5 a month

One app for a side project. Issues and alerts, with a 14-day dashboard window.

Start my 14-day trial
TeamRecommended
$15 a month

Up to 3 apps and 5 people per team. Full history, the MCP server, data clearing and agent health.

Start my 14-day trial
Agency
$69 a month

Unlimited client apps and people, one overview of every app, and apps you can hand over.

Start my 14-day trial