Section 14.39

Little’s law

Definition

Little’s law is a theorem of queueing theory: for any system that items enter and leave, the long-run average number of items inside equals the long-run arrival rate times the average time an item spends inside, L=λWL = \lambda W. Here LL is the time-average number of items in the system, λ\lambda the number of arrivals per unit time and WW the mean time from an item’s entry to its exit. The law holds whatever the arrival pattern, service times or order of service, provided these long-run averages exist and are finite.

The idea

A hotel receives 10 new guests per night on average, and a guest stays 3 nights on average. On an average night 10×3=3010 \times 3 = 30 rooms are occupied. When guests arrive, how long each one stays and who leaves first do not change that average. A computing service behaves the same way. If it receives 1000 requests per second and each request stays 50 ms from arrival to response, then on average 1000×0.05=501000 \times 0.05 = 50 requests are in progress at once. A design that can work on only 10 requests at once, each for its full 50 ms, completes at most 10/0.05=20010 / 0.05 = 200 requests per second.

The law is two ways of adding up the same quantity. Each item that is inside the system for one second contributes one item-second. Adding up the number of items inside, moment by moment over a period, gives the total item-seconds. Adding up, item by item, how long each one stayed gives the same total. Dividing both by the length of the period turns the first sum into the average number inside and the second into the number of items per unit time times the average stay. On a graph of the number inside against time, the two sums are the area under the graph cut into vertical slices, one per moment, or into horizontal bars, one per item from its entry to its exit.

How it works

  1. Choose the boundary: an entry event and an exit event. Everything between them is the system. Common choices are the queue alone (from arrival to the start of service), the server alone (from the start to the end of service), and the whole (from arrival to completion).

  2. Choose the population: which items count, such as all requests or only one class of them. Items that leave by another exit, because they were dropped after entering, canceled or timed out, still belong to the population, and their time inside up to that exit counts. Items refused at the entrance never entered, so λ\lambda is the admitted arrival rate, not the offered one.

  3. Measure all three quantities at that boundary, for that population, over the same period: LL as the time-average of the number inside, λ\lambda as entries per unit time, and WW as the mean time from entry to exit. The units must agree: with λ\lambda in items per second and WW in seconds, LL is in items. In a system whose content does not grow without limit, the long-run exit rate equals λ\lambda.

  4. Use any two of the quantities to find the third.

The law applies at every boundary, each time with that boundary’s quantities. For the queue alone, the mean number waiting is Lq=λWqL_q = \lambda W_q, where WqW_q is the mean waiting time. For one server alone, the mean number in service equals λ\lambda times the mean service time; one server holds at most one item, so that mean is the fraction of time the server is busy, its utilization. For the whole system, L=λWL = \lambda W.

Worked example

Request A is inside from time 0 to 2 s, and request B from 1 s to 3 s. Observe the window from 0 to 3 s. The number inside is 1 from 0 to 1 s, 2 from 1 to 2 s, and 1 from 2 to 3 s. The area under that graph is 1×1+2×1+1×1=41 \times 1 + 2 \times 1 + 1 \times 1 = 4 request-seconds. Counted by request, A stayed 2 s and B stayed 2 s, which gives 2+2=42 + 2 = 4 request-seconds: the same total.

The average number inside is L=4/3≈1.33L = 4 / 3 \approx 1.33 requests. Two requests arrived in 3 s, so λ=2/3\lambda = 2/3 per second, and their mean time inside is W=(2+2)/2=2W = (2 + 2) / 2 = 2 s. Then λW=(2/3)×2=4/3\lambda W = (2/3) \times 2 = 4/3, equal to LL. The match is exact because the system was empty at the start and at the end of the window, so both requests’ whole stays lie inside it.

Now add request C, which enters at 2.5 s and is still inside at 3 s. The area becomes 4+0.5=4.54 + 0.5 = 4.5 request-seconds, so L=4.5/3=1.5L = 4.5 / 3 = 1.5. Using completed requests only still gives λW=(2/3)×2≈1.33\lambda W = (2/3) \times 2 \approx 1.33, which misses C’s half second. Counting C as an arrival but taking WW from completed requests gives (3/3)×2=2(3 / 3) \times 2 = 2, which is too high. Both pairs are inconsistent, because C’s total stay is unknown at 3 s, a case of right censoring §11.28. The exact count uses C’s time inside the window, 0.5 s. Over a long window the error from such edge items shrinks compared with the total, which is why the law is stated for long-run averages.

At the server boundary: if requests arrive at 5 per second and each needs 0.1 s of service, the server holds on average 5×0.1=0.55 \times 0.1 = 0.5 requests in service, so it is busy half the time.

Stated precisely

Finite window. Let N(t)N(t) be the number of items in the system at time tt. For each item ii, let aia_i be its entry time and did_i its exit time, and let oio_i be the time that item ii spends inside during the window from 0 to TT: the length of the overlap of the intervals [ai,di][a_i, d_i] and [0,T][0, T]. Then, with no further assumption, ∫0TN(t)dt=∑ioi,\int_0^T N(t)\, dt = \sum_i o_i, where the integral is the area under the graph of N(t)N(t) from 0 to TT. If the system is empty at times 0 and TT, every item counted entered and left inside the window, so oi=di−aio_i = d_i - a_i. Dividing by TT, with nn such items, gives exactly LT=λTWTL_T = \lambda_T W_T, where LT=1T∫0TN(t)dtL_T = \frac{1}{T} \int_0^T N(t)\, dt, λT=n/T\lambda_T = n / T and WT=1n∑i(di−ai)W_T = \frac{1}{n} \sum_i (d_i - a_i).

Long run. Let A(t)A(t) be the number of arrivals up to time tt, and WiW_i the time in the system of the ii-th item to arrive. If the limits λ=limt→∞A(t)tandW=limn→∞1n∑i=1nWi\lambda = \lim_{t \to \infty} \frac{A(t)}{t} \quad \text{and} \quad W = \lim_{n \to \infty} \frac{1}{n} \sum_{i=1}^{n} W_i exist and are finite, then the limit L=limT→∞1T∫0TN(t)dtL = \lim_{T \to \infty} \frac{1}{T} \int_0^T N(t)\, dt exists and L=λWL = \lambda W. This version needs no probability model; it holds for each individual run. Little published the first proof in 1961, for systems described by stationary random processes, whose statistical behavior does not change over time, with finite means. Stidham proved the version for individual runs stated here in 1974 [251].

Limits and common mistakes

The law relates three means. It says nothing about the distribution of times in the system, tail latency §11.36, the worst case or whether a deadline is met.

The law does not say how one quantity responds when another changes. Raising the arrival rate usually raises WW as well; by how much is a question for models of queueing delay §14.38, not for this law.

Mixing boundaries or populations gives wrong answers without any warning: an arrival count from one boundary with a time in the system measured at another, or a submission rate combined with the mean latency of completed requests only. Computing WW over successful requests alone is survivorship bias §11.30 when failed requests also occupied the system.

Over a short window, items that cross the window’s edges make the averages disagree unless their partial times are counted. A window that starts and ends with an empty system avoids the problem.

If the system is unstable, with a queue that grows without limit, the long-run averages do not exist and the long-run form of the law cannot be applied, although the finite-window identity still holds for every window.

Questions answered

Which boundary defines the system and which arrivals and completions are counted?

The analyst defines the boundary by choosing an entry event and an exit event, and Little’s law L=λWL = \lambda W, average number inside equals arrival rate times average time inside, holds only when all three quantities are measured at that one boundary, for one population, over the same period. Typical boundaries are the queue alone (arrival to start of service), the server alone (start to end of service) and the whole system (arrival to completion); each gives its own version of the law.

Arrivals are the items that cross the entry event. Items refused before entry, for example by a full buffer, are not arrivals, so the admitted rate is used, not the offered rate. Completions are all exits, not only successful ones: an item that is dropped, canceled or times out after entering leaves the system at that moment, and its time inside counts in WW. Over a finite window, an item that is inside at the start or the end must contribute the part of its stay that lies inside the window, or the window must start and end with the system empty. A count of submitted requests paired with the mean latency of completed requests alone is not a valid pair, because the two describe different populations.

Related entries: Queueing delay (§14.38), Censoring (§11.28), Finite-window rate (§11.41), Survivorship bias (§11.30). Further reading: [88, 251].