Answers · The systems around the model
How can I tell if my traffic is bursty or just high volume?
In shortCompare the variance of the gaps between arrivals with the square of their average gap: high volume alone does not make traffic bursty.
High volume is an average; burstiness is a variance. The test is to take the gaps between successive arrivals and compare their variance with the square of their mean: a high average with steady gaps is high volume, a lower average with wildly uneven gaps is bursty.
Write for the gap between one arrival and the next, in seconds. Regular arrivals, one every second, have every time: the mean is and the variance is , so . Independent random arrivals with the same mean gap have exponential gaps, whose variance equals the square of their mean: with mean the variance is , so . That is the standard random case, not an especially bursty one. The number to compare against is , not .
Now keep the same mean gap of one second and make the arrivals clump. Suppose nine gaps in ten are zero and one gap in ten is ten seconds. The mean is second. The second moment is , so the variance is . The clumping measure is . The average rate is unchanged at sixty a minute, but the spacing is nine times as variable as independent random arrivals. A zero gap is an idealisation of arrivals that are very close together, and the arithmetic is what matters: the same mean can carry a very different variance.
| pattern | mean gap (s) | variance (s) | ||
|---|---|---|---|---|
| Regular, one every second | 1 | 0 | 0 | 0.5 |
| Independent random | 1 | 1 | 1 | 1 |
| Nine zero gaps in ten, one ten-second gap | 1 | 9 | 9 | 5 |
Checking the wait
If the raw gaps are not available, the same quantity can be recovered from waiting times. Let be the wait the standard random-arrival formula predicts at the observed utilisation and service time, and let be the wait actually observed. The relation rearranges to the diagnostic form. The two routes measure the same gap variance. Use the first when you have timestamps of individual arrivals; use the second when you have only latency and load. If both are available they check each other: a gap-based of nine should appear as a wait about five times the random-arrival prediction, and a wait five times the prediction should not be explained by a gap-based near one.
At eighty per cent utilisation with a two hundred millisecond service time, the standard formula gives seconds. If the measured wait is two seconds, then . Check: seconds. A service whose wait is three times the prediction has . That is a statement about the spacing of arrivals, not about the servers being slow.
Volume and clumping compound
High volume raises the utilisation and therefore raises both and the wait produced by any fixed . Burstiness raises and multiplies whatever wait the utilisation already produces. The two are not alternatives. At sixty per cent load a clumping measure of nine gives a multiplier of five; at ninety per cent the same multiplier applies to a much larger , so the absolute wait is far larger. This is why a dashboard showing requests per second can make two systems look identical: the average rate is the same and the clumping is invisible.
The natural guess is to compare peak rate with average rate and call the difference burstiness. That can be misleading, because a single peak over a long window is diluted by the window, and a stream of small clumps can leave the peak low while making every clump wait. The variance of gaps catches the clumping at the scale that matters to the queue. A high average with near one is high volume, not bursty. A modest average with of nine is bursty, not high volume.
Where it stops being true
The measure assumes a stationary window. If the morning is smooth and noon is clumped, one averages two regimes; compute it over a window in which the mean gap is roughly stable, and preferably over several windows to see the spread. It also assumes the service time is known. A far above ten is possible for synchronised timers and retries, but it is also what a badly measured service time produces, so check that first. With few arrivals the variance estimate is noisy; a dozen gaps cannot distinguish from reliably.
Worth keeping
- High volume is an average arrival rate; burstiness is the variance of the gaps between arrivals relative to the square of their mean.
- The clumping measure is zero for regular arrivals, about one for independent random arrivals, and above one for bursty traffic.
- If the measured wait is W and the standard formula predicts k, the clumping measure is 2W/k minus 1.
Where this goes next
This question is one step of Work That Waits in a Queue, a course that works through its subject from the beginning. The page that teaches this part of it is Arrivals Come in Clumps, and it reads the whole way through whether or not you have an account.
What an account changes is the practice: problems standing under every idea, marked with a reason rather than a tick, in a copy of the course that is yours.
Read that pageThe whole courseOther questions people ask about this
- Why does average latency hide the slow requests users actually feel?Waiting times are lopsided, so the average sits between the common case and the bad case and describes neither, and it is the bad case that users keep meeting.
- How can I estimate wait time from the number of requests in the system?Divide the average number of requests inside the system by the rate at which they arrive, and you get the average time each request spends there.
- What's the difference between a CDN cache and caching inside my own app?A CDN cache sits near the user and can only hold answers that are identical for everyone, while a cache inside your app can be personal but exists once per process.
- What's the difference between LRU and LFU, and which one should I use?LRU drops the item unused for longest; LFU drops the item requested least often. Both guess at future use, and the cheap win is refusing one-off arrivals rather than counting requests.
- Why can't a system just stay consistent and available when the network splits?During a split, a cut-off machine can only answer from the data it already holds, so it must either risk being wrong or refuse to answer.
- Should the gradients be summed or averaged across GPUs?Sum the gradients when each device already divides its loss by the global batch size; average them when each device uses its own local mean. Doing both makes the gradient too small by the number of devices.