Every user of a distributed system feels latency: a page does not open, a transaction is not confirmed, and a model cannot answer faster than data can cross the network and be processed. Latency cannot be reduced to zero, because it has a physical limit, so it is measured, described with percentiles and built into the architecture.
What latency is made of
Everything along the way affects a request’s journey from client to server and back:
| Factor | What happens | Order of magnitude |
|---|---|---|
| Medium and distance | the signal travels through fibre or radio; fibre is faster than wireless | about 5 ms per 1,000 km of fibre |
| Transmission onto the link | the packet is serialised byte by byte on each outgoing port | 1,500 bytes at 1 Gbit/s: about 12 µs |
| Routing hops | each router on the path consults its routing table and forwards the packet | microseconds per node, with dozens of nodes |
| Server processing | the application and database compute the response | milliseconds |
| Queuing | under load, requests wait for a free processor or link | from zero to hundreds of milliseconds when overloaded |
The practical conclusion is that even a perfectly tuned system cannot respond faster than geography allows. Tashkent and Frankfurt are about 4,700 km apart in a straight line. A signal in fibre needs at least 23 ms one way, so the full round trip takes twice as long, before any processing at intermediate nodes.
RTT: why we measure the full round trip
The simplest thing to measure is the time for a full round trip, the RTT (round-trip time), as the ping utility does. RFC 2681 defines the round-trip delay metric as the time from the source sending a packet to the response arriving back at the source. Such a measurement needs no special software on the other end and no synchronised clocks at both ends, which one-way delay measurement requires. The price of simplicity is inaccuracy: the outbound and return paths may differ, so RTT actually measures two different routes at once, and one-way delay is estimated as half the round trip.
Percentiles: p95 and p99
The average latency hides the worst cases. In an example from the Google SRE book, a typical request is served in about 50 ms, but 5% of requests take twenty times longer, and the average does not show it. So latency is described with percentiles, the values below which a given share of requests fall:
| Percentile | Meaning | Example for 1,000 requests |
|---|---|---|
| p50 (median) | half of requests are faster than this value | 20 ms |
| p95 | slower: 50 requests out of 1,000 | 80 ms |
| p99 | slower: 10 requests out of 1,000 | 250 ms |
| p99.9 | slower: 1 request out of 1,000 | 800 ms |
That is why quality is not promised “on average”: an SLO target is phrased as “99% of requests faster than 300 ms”, which is a percentile target. The tail also compounds: a page with ten parallel sub-requests hits the slow 1% with a probability of almost 10%, so the p99 of the whole page ends up noticeably higher than that of each service on its own.
Sources
the term is written from these pagesVerified 9 Nov