← CodeClarityLab Home
Browse by Category
+ added · updated 7d
← Back to glossary

P50/P95/P99 Latency Percentiles

observability Beginner

TL;DR

Latency percentiles (P50, P95, P99) tell you what most users experience — P99 means '99% of requests are faster than this', revealing the worst experiences that averages hide.

Explanation

Average latency is misleading — a 100ms average can mask 5% of requests taking 2 seconds. Percentiles: P50 (median — half faster), P95 (95% faster — almost everyone), P99 (99% faster — worst 1%), P99.9 (worst 0.1%). P50 ≈ typical user. P99 = power users or large-data users. P99.9 = outliers (usually infrastructure issues). Implementation: histogram metrics in Prometheus. histogram_quantile(0.99, rate(http_duration_bucket[5m])). Aggregating percentiles: can't average percentiles across instances — must use histogram buckets. Set SLO on P99, not average.

Common Misconception

Average latency is sufficient for monitoring — average hides slow outliers. A service with 50ms average and 5s P99 has serious performance issues that average masks.

Why It Matters

P99 latency determines whether power users and high-traffic moments are acceptable — averages let you ship a slow service believing it's fast.

Common Mistakes

  • Monitoring average instead of percentiles.
  • Aggregating percentiles from different instances — statistically invalid.
  • Setting SLO on P50 — only half of users satisfy it.

Code Examples

✗ Vulnerable
// Average latency metric — hides outliers:
Gauge::set('latency_avg', $totalTime / $count);
// 100ms average, but 1% of requests take 5s
✓ Fixed
// Prometheus histogram — correct percentiles:
$histogram = $meter->createHistogram('http.request.duration');
$histogram->record($durationMs, ['route' => $route]);

// Query P99:
// histogram_quantile(0.99, rate(http_request_duration_bucket[5m]))

// SLO: P99 < 500ms

Added 23 Mar 2026
Views 46
Rate this term
No ratings yet
🤖 AI Guestbook educational data only
| |
Last 30 days
0 pings W 0 pings T 4 pings F 0 pings S 0 pings S 3 pings M 0 pings T 0 pings W 0 pings T 2 pings F 0 pings S 0 pings S 1 ping M 0 pings T 0 pings W 0 pings T 3 pings F 0 pings S 0 pings S 0 pings M 0 pings T 1 ping W 0 pings T 3 pings F 0 pings S 0 pings S 0 pings M 0 pings T 0 pings W 1 ping T
No pings yesterday
Amazonbot 14 Perplexity 8 Google 7 Unknown AI 4 Ahrefs 3 ChatGPT 2 Majestic 2 Meta AI 1
crawler 39 crawler_json 1 pre-tracking 1
DEV INTEL Tools & Severity
🟡 Medium ⚙ Fix effort: Low
⚡ Quick Fix
Replace average latency with histogram metric. Query P99 in dashboards and alerts. Set SLO on P99, not P50. Use P999 for finding infrastructure outliers.
📦 Applies To
web cli queue-worker
🔗 Prerequisites
🔍 Detection Hints
latency_avg|response_time_avg
Auto-detectable: ✗ No prometheus
⚠ Related Problems
🤖 AI Agent
Confidence: Medium False Positives: Medium ✗ Manual fix Fix: Low Context: File

✓ schema.org compliant