hn.today

Lorenz and Little: How Much Does Your Tail Cost?

brooker.co.za3 points0 comments
Screenshot of Lorenz and Little: How Much Does Your Tail Cost?

This explains a practical method to quantify how much each latency percentile contributes to average latency by computing an empirical Lorenz curve from latency samples or reported quantiles. Given sorted samples the Lorenz value L(p) is the cumulative share of total latency up to percentile p, and 1−L(p) is the share coming from requests at or above p. When only quantiles are available the write-up uses a power‑law interpolation/extrapolation and provides a Python implementation called OneMinusL. An example run shows that requests at or above the median can account for roughly 99% of mean latency, at or above p99 about 52%, and at or above p99.9 about 10%, demonstrating how concentrated mean latency can be in the tail.

The practical point is that, by Little’s law, these same shares map to shares of system concurrency, so reducing tail latency directly reduces busy threads, capacity needs, lock contention and cost. Because tails are disproportionately expensive to serve, focusing on tail improvements can yield outsized capacity and performance benefits. The write-up cautions that interpolation/extrapolation choices and small samples or heavy tails can make extreme‑percentile estimates noisy, and that exact empirical answers require raw sorted samples rather than fitted quantiles.

Read on brooker.co.za0 comments on Hacker News

Summary generated by AI from the linked article. hn.today is not affiliated with Hacker News or Y Combinator.

More in Web

The daily digest

Today's best Hacker News stories, summarized and screenshotted, one email a day.