If you only watch average response time, you can miss the requests that hurt your users most. To measure API performance p95 p99 correctly, you need to look at the slow tail of your traffic, not the middle. Averages smooth over the worst experiences. Percentiles keep them visible, but only if you collect and read them the right way.
Most teams already have the data. The problem is usually how they slice it: one number for the whole API, one window for the whole day, errors quietly left out. This guide walks through what p50, p95, and p99 mean, what they hide, and how to read api latency percentiles and set up api response time monitoring you can actually act on.
What p50, p95, and p99 Actually Mean
A percentile answers a simple question: how slow were the slowest requests? Take 100 requests, sort them from fastest to slowest, and read off a position. The p50, or median, is the middle request. Half were faster, half were slower. The p95 is the request at the 95th position: 95 out of 100 requests finished at or below that time, and 5 were slower. The p99 works the same way: 99 finished at or below it, and 1 was slower.
That is p99 latency explained in one line: it describes the experience of roughly the slowest one percent of your requests. If your p99 is 900 milliseconds, about one in a hundred requests took 900 milliseconds or longer. For an endpoint that serves thousands of requests a minute, that one percent is a lot of real users.
Percentiles beat averages because latency is almost never spread evenly. A typical API has a cluster of fast responses, a long tail of slow ones, and a few outliers that take seconds. The average sits somewhere in the middle and tells you nothing about either end. The p50 tells you what a typical request feels like. The p95 and p99 tell you what a bad request feels like, and bad requests are the ones users remember.
Why the Average Lies About Your API
Picture an endpoint with an average response time of 120 milliseconds. It sounds healthy. Now picture the same endpoint split in two: 95 percent of requests finish in 60 milliseconds, and 5 percent take over two seconds because they hit a cold cache or a slow downstream call. The average still reads 120 milliseconds. The users in that 5 percent wait more than thirty times longer than everyone else, and the average never shows it.
This is the most common way teams fool themselves. A single slow dependency, a handful of large payloads, or a nightly batch job that shares the same database can all hide inside a good-looking average. Percentiles force the tail into view. When you debug a slow API endpoint step by step, the first useful question is usually which requests are slow, not how slow the average request is.
How to Measure API Performance p95 p99 in Practice
Good percentile latency measurement starts with recording every request, or a fair sample of them, with three fields at minimum: the endpoint, the duration, and whether it succeeded. Without the endpoint, a slow admin report pollutes the numbers for a fast login call. Without the success flag, failed requests that return in 20 milliseconds can make your latency look better than it is.
Store durations in a histogram, not as a running average. A histogram groups requests into buckets, such as under 10 milliseconds, 10 to 50, 50 to 100, and so on, and counts how many fall in each. From those counts you can compute any percentile later, for any window, without keeping every raw value. Prometheus histograms with histogram_quantile, and similar features in other monitoring tools, work this way. If you average percentiles from two services or two time windows instead, the result is meaningless, because percentiles cannot be averaged.
Measure at the point that matches the question you are asking. Server-side timing tells you how long your code took. Client-side timing adds network travel, DNS, TLS, and retries, which is what the user actually feels. For an SLO that promises users a fast experience, client-side or edge timing is the honest one. For finding slow code, server-side timing is the useful one. Pick one per dashboard and label it, so nobody compares the two by accident.
What p95 and p99 Hide
Percentiles are better than averages, but they still hide plenty. The first blind spot is mixing unlike requests. A p95 computed across every endpoint blends fast health checks with slow file uploads, and the result describes neither. Always split by endpoint first, then by anything else that changes cost: authenticated versus anonymous, small versus large payloads, one region versus another.
The second blind spot is the tail beyond the number you watch. If you only track p95, the slowest 5 percent is a black box. A p99 of 800 milliseconds and a p99 of 8 seconds can sit behind the same p95. Track p99 alongside p95, and look at the maximum and the slowest individual requests when something looks wrong. The worst requests often share a cause, such as a single customer with an oversized payload or a query that scans a whole table, and you will only find it by looking at them directly. That is where distributed tracing earns its keep: it shows which span in a slow request ate the time.
The third blind spot is what never gets recorded. Timeouts, dropped connections, and requests that never reach your server do not appear in server-side latency at all. Neither do requests your load balancer rejects. If your error rate rises while latency looks fine, check whether the slowest requests are failing before they are measured. A complete picture needs error rates next to latency, from the same window, on the same dashboard. Good observability for small teams usually means exactly this: logs, metrics, and traces that agree with each other, not three tools telling three stories.
The Mistakes That Make Percentiles Useless
The most common mistake is averaging percentiles. You cannot average the p95 of two services, or the p95 of Monday and Tuesday, and get a real p95. The correct way is to combine the underlying histograms or raw data and compute the percentile once. Every time you see a dashboard that averages percentiles across regions or instances, treat its numbers as rough guesses.
Another mistake is measuring the wrong thing and calling it latency. Time to first byte is not total response time. Time spent in your handler is not time spent in the queue before the handler started. If requests wait in a queue during a traffic spike, users feel that wait even though your handler looks fast. Record queue time separately when your setup allows it, and include it in the number users actually experience.
Turning Percentiles Into SLOs People Can Act On
A percentile becomes useful when it turns into a promise with a number and a window: 95 percent of requests to the checkout endpoint finish within 300 milliseconds over a rolling 30 days. That is an SLO, and it gives the team a shared definition of good enough. Without the window, the promise means nothing. Without the endpoint, it cannot be measured.
Pair the SLO with an error budget, which is the room you have to miss the target before you slow down and fix things. If the target is 95 percent within 300 milliseconds, the budget is the other 5 percent. Spend it on deploys, experiments, and the occasional bad day. When the budget runs low, stop shipping features and fix reliability instead. The mechanics of that trade-off are covered well in our guide to error budgets and when to stop shipping, and the same logic applies whether your team is two people or two hundred.
Review SLOs on a schedule, not only when they break. Traffic patterns change, endpoints get new features, and a threshold that made sense six months ago can be too loose or too strict today. A short monthly review, looking at p50, p95, and p99 per endpoint side by side, catches drift before users complain.
A Short Checklist Before You Trust Your Numbers
Run through this list before you quote a percentile to anyone. Split latency by endpoint, and by anything else that changes cost. Record errors and timeouts alongside latency, from the same window. Compute percentiles from histograms or raw data, never by averaging percentiles. Measure where the user feels it, and label server-side and client-side numbers so nobody mixes them up. Watch p99 as well as p95, and look at the slowest real requests when the tail moves. Then write the SLO down, give it a window, and review it monthly. If every item on that list holds, your numbers describe reality.