What is Tail latency?

The slow end of the response-time distribution, such as the 99th percentile, which governs overall latency when a task waits on many components.

Field: Performance Analysis

Japanese name: テールレイテンシ

Why look at the slow end rather than the mean

Suppose one request queries 100 servers and must wait for every reply. If each server is slow 1% of the time, the chance that none is slow is 0.99 to the 100th power, only about 37%, so about 63% of requests wait on at least one slow reply. The more a task is split across parallel components, the more each component's rare delays become the whole system's typical latency. That is why targets are set on the 99th or 99.9th percentile (p99, p99.9).

Where the delays come from

Systems that are fast on average still see occasional long delays. Causes include queues growing under high load, garbage-collection pauses, background work, contention with other tasks for shared resources, CPU frequency changes and wake-up from power-saving states, and packet retransmission in the network. SSDs also slow down when internal garbage collection overlaps with reads and writes, so their specifications sometimes give percentile latencies as well as averages.

Reducing it, and measuring it correctly

Remedies include keeping utilization below saturation, isolating heavy background work, and hedged requests, which send the same request to another replica if no reply arrives within a set time. Percentiles are computed from response-time histograms. Averaging the p99 values of several servers does not give the overall p99; the distributions must be merged first. And if the load generator waits for responses before issuing the next request, requests during slow periods are undercounted, which can make the tail look smaller than it is.

Try it: questions about Tail latency

When evaluating web service response times, why is the 99th percentile (the boundary of the slowest 1%) often examined in addition to the mean?

  1. AThe mean can look good while some requests are very slow, and when a task waits on many components, those slow responses set overall latency
  2. BThe 99th percentile is always smaller than the mean
  3. CThe mean cannot be calculated
Show answer and explanation

Answer: A. The mean can look good while some requests are very slow, and when a task waits on many components, those slow responses set overall latency

Response-time distributions tend to be mostly fast with a small, very slow tail. Looking only at the mean hides that tail. Moreover, when rendering a page waits on 100 components, any one slow response makes the whole slow. If each component is independently slow 1% of the time, 1 − 0.99^100 ≈ 0.63, so more than 60% of users are affected. Systems are therefore managed against targets for the slow end (tail latency).

Books on Performance Analysis Ad

As an Amazon Associate I earn from qualifying purchases.

Semiconductor, Electronics and Computing Calculators

This page was drafted with AI and fact-checked by a separate AI review before publication. Our Editorial policy explains how we write and check content. If you spot an error, please tell us on our Contact page.

Back to the glossary