liveBook · Manning

Little's law

As explained in Latency

Little's law is a queuing-theory theorem stating that the average number of items in a system equals the average arrival or throughput rate multiplied by the average time an item spends in the system.

Little’s law connects three averages in a computing system: concurrency C, throughput T, and latency L. Its practical form is C = T × L, or L = C / T. Here, concurrency is the average number of requests or operations in the system, throughput is the rate completed, and latency is the average time each spends there. section 2.1.1 section 9.1

Estimate requests in flight

At 1,000 requests per second and 50 milliseconds (0.05 seconds) of average latency, C = 1,000 × 0.05 = 50 requests. The result describes an average number in the system, not a count of requests actively using a processor. section 2.1.1

At fixed throughput, more concurrency corresponds to higher average latency. Requests may wait when they compete for CPU, memory, or I/O bandwidth. To reason about a latency target, estimate the concurrency it implies, then consider whether throughput can improve or the amount of queued work needs managing. Treat the calculation as a model: measure latency to check its assumptions, and inspect the latency distribution as well as its average. section 2.1.1 section 9.1 section 2.1 section 2.7

Figure 2.1 Latency vs. concurrency when throughput varies. The graph shows latency (y axis) as a function of throughput and concurrency (x axis).

The plot shows how the relationship between concurrency and latency changes at different throughput rates. section 2.1.1

How Latency covers it

How deep it goes
Defines C = T × L, rearranges it for latency, and works through request calculations; does not develop a theorem proof.
Examples
Calculates 50 concurrent requests from 1,000 requests per second and 50 milliseconds of average latency.
What it assumes
Assumes familiarity with latency and throughput but defines concurrency as context-dependent simultaneous events or operations.
What you can do after
Evaluate/understand average request concurrency and latency targets from measured throughput and latency, then check the model against measurements.
How it connects
Connects throughput and latency to concurrency, queue length, and resource contention; pairs with Amdahl’s law for performance reasoning.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Latency. The section links point to the parts of the book it draws on.