Skip to content
IT glossary
ArchitectureUpdated December 3, 2026

Latency

Задержка

Latency measures how long it takes to reach a result, such as receiving a response after sending a request. p99 is one way to summarize latency: it is the time within which roughly 99% of measured operations finish.

Also known as: латентность, p99

What latency measures

Latency is the elapsed time between a defined start and end. For an API, a client might start the clock when it sends a request and stop it when it has read the full response. A server might instead measure only from the moment its handler starts until that handler returns. Both measurements are useful, but they answer different questions. For a streaming response, time to the first byte and time to the last byte can tell very different stories.

Where the time goes

Imagine tapping Search in a shopping app. The request travels over the network, may wait for a worker or a database connection, and then triggers a query. The service builds a response and sends it back. If you're measuring from tap to visible results, the app's rendering time counts too. A query that takes only 20 ms doesn't guarantee a fast search: the request might already have spent 200 ms waiting for a connection. Use end-to-end measurements to see what users experience and traces to locate the slow stage.

Why teams track p99

A single average can hide requests that take much longer than the rest. The median (p50) shows what a typical request experiences, while p95 and p99 show how far into the slow end of the distribution you have to look. A p99 of 450 ms means roughly 99% of the measured requests took 450 ms or less. It is not the average of the slowest 1%, and it doesn't tell you how long the slowest request took.

Suppose a checkout API reports a p50 of 60 ms and a p99 of 450 ms over five minutes. Most requests are well below half a second, yet roughly one in a hundred exceeds 450 ms. Before deciding whether that's acceptable, check how many requests were measured and whether timeouts were counted. A p99 based on a handful of requests is unstable, and a dashboard that tracks only completed requests can look healthier as more requests time out.

Latency versus throughput

Throughput measures completed work per unit of time, such as responses per second. Latency measures the time spent on one operation. A service can process more requests per second by batching work while making individual requests wait longer for a batch to fill. Load tests should track both measures along with errors and timeouts: once a service is near capacity, queues can grow even if completed requests per second barely change.

How it comes up in interviews

A system design interviewer may ask how you'd meet a target such as “99% of catalog requests finish within 200 ms.” Start by defining where you measure, which requests count, and over what window. If the system has multiple replicas, don't average their p99 values: a busy replica and a quiet one don't contribute equally. Compute the overall percentile from combined observations or merge compatible latency histograms before estimating it.