Vibe Engines
YouTube

Vibe Engines is free, interactive AI engineering & system design — runs in your browser. Pick a learning path

Little's Law Calculator

Little's Law ties the three numbers every capacity plan rests on: the average number of in-flight requests, the throughput, and the latency. Solve for whichever you don't know — size a connection pool from QPS and latency, back out the latency a queue depth implies, or find the throughput a fixed worker count can sustain. Includes a utilisation read-out so you can see when you're driving the system into the danger zone.

Solve for
20.0 Concurrency · in-flight requestsL = λ × W
83%utilisation · 20.0 of 24 slots

Hot. Past ~80% utilisation, small bursts cause large queue spikes. Keep steady-state headroom for variance.

L = λ × W holds for the long-run average of any stable system. It sizes for the mean — add headroom for the tail (p99 spikes, bursts) it deliberately ignores.

Little’s Law ties together the three numbers that describe any busy system: how many requests are in flight, how fast they arrive, and how long each one takes. Pick any two and the third is fixed. This calculator solves for whichever one you choose, then compares the concurrency with the number of servers, workers or connections you have.

What it computes

L = λ × W          Solve for: Concurrency
λ = L ÷ W          Solve for: Throughput
W = L ÷ λ          Solve for: Latency
ρ = L ÷ servers    utilization of your slots
  • L is the average number of requests inside the system at once, whether being served or waiting.
  • λ (lambda) is the average arrival rate in requests per second. In a stable system arrivals equal completions, so this is also your throughput.
  • W is the average time a request spends inside the system. You enter it in milliseconds and the tool divides by 1,000, so the units multiply out: requests per second × seconds = requests.
  • servers is how many requests you can serve at once: worker processes, threads, pool connections or GPU slots. Utilization ρ is L as a share of them.

The utilization bar has three bands: below 80% reads “Healthy headroom”, 80% up to 100% reads “Hot”, and 100% or more reads “Over capacity”. Results of 1,000 or more display as whole numbers, 10 to 999 with one decimal, and anything smaller with two.

A worked example

The defaults solve for concurrency with a throughput of 500 requests per second, a latency of 40 ms and 24 servers.

  1. Convert latency: 40 ms ÷ 1,000 = 0.04 s.
  2. Concurrency: L = 500 × 0.04 = 20, shown as 20.0 in-flight requests.
  3. Utilization: ρ = 20 ÷ 24 = 0.833, shown as 83% (“20.0 of 24 slots”). That is past the 80% line, so the panel reads Hot.
  4. Switch to Throughput and the same numbers come back the other way: 20 in flight at 40 ms is 20 ÷ 0.04 = 500.0 requests per second. Switch to Latency: 20 ÷ 500 × 1,000 = 40.0 ms.
Change from the defaultsConcurrency LUtilization of 24Band
None: 500 req/s at 40 ms20.083%Hot
Latency doubles to 80 ms40.0167%Over capacity
Traffic falls to 300 req/s12.050%Healthy
Servers raised to 3020.067%Healthy
Traffic rises to 600 req/s24.0100%Over capacity

The second row is the one to remember. A downstream slowdown with no change in traffic doubles the concurrency you need, which is how a slow database turns into an exhausted worker pool.

Assumptions and limits

  • A stable system. The law holds for long-run averages when arrivals and completions balance. If the queue is growing because arrivals exceed capacity, there is no steady state and the averages keep drifting.
  • Averages, not tails. Concurrency fluctuates around L. Bursts and slow requests push the instantaneous count well above it, so the mean is a floor, not a size.
  • One boundary for all three numbers. λ, W and L must describe the same system. Time measured at the load balancer includes network and queueing that a database pool never sees.
  • Utilization is approximate. L ÷ servers is the true busy fraction only when W is the time a request actually occupies a slot. If W includes time spent waiting for a slot, L counts the waiting requests too, and the ratio measures demand rather than busy time.
  • Latency depends on load. The tool treats W as a fixed input, but real latency climbs as utilization nears 100%. In the simplest single-server queue model (M/M/1), the average time in the system is the service time divided by 1 − ρ: 5 times the service time at 80% busy and 10 times at 90%.

How to use the result

  • Size a pool or worker count. Take peak throughput and the latency at peak, compute L, then divide by your target utilization. For the defaults, 20 ÷ 0.75 = 26.7, so 27 slots keeps you at 75%.
  • Find the ceiling of what you have. Rearranged, maximum throughput is servers ÷ W: 24 slots at 40 ms complete at most 600 requests per second, or 480 at 80% busy.
  • Read a queue as a wait. W = L ÷ λ turns a backlog into time: 50 jobs in the system with 200 arriving per second means each spends 250 ms inside.
  • Sanity-check dashboards. If measured in-flight requests are far from throughput × latency, the metrics are measuring different boundaries or the system is not stable.
  • Keep headroom for variance. The 80% line is a rule of thumb. Spiky traffic and long tails need more margin; smooth traffic spread across many servers can run hotter.

When to use it, and when not

Use it whenever two of the three numbers are known and the third is the decision: how many workers a queue consumer needs, how big a database pool should be, what throughput a fixed fleet can reach, or how long a backlog will take to clear. It is also the quickest test of whether three dashboard numbers agree with each other.

Do not use it to predict how latency will change as load grows. The law relates averages that you supply, and it has no model of queueing, so it cannot say what W becomes at 95% busy. Nor does it apply during an overload, when arrivals exceed completions and the queue grows without bound. For that you need a queueing model or a load test.

Trade-offs and limits

The law gives the mean number in flight, not how much queueing the bursts around that mean cause. A standard queueing model, M/M/c (random arrivals, random service times, c servers), shows what the utilization bar leaves out. At the defaults, 500 requests a second with 40 ms of service:

ServersUtilizationRequests that waitAverage W
2195.2%76.1%70.4 ms
2290.9%56.8%51.4 ms
2483.3%29.8%43.0 ms
2774.1%9.6%40.5 ms
3066.7%2.5%40.1 ms

Two lessons follow. Pooling helps a lot: at the same 83% a single server would average 240 ms, six times the service time, while 24 shared servers average 43 ms. And the last few servers matter most: going from 21 to 24 cuts the average wait from 30.4 ms to 3.0 ms. Real traffic is often burstier than this model assumes, so treat its numbers as a best case.

Common mistakes

  • Using request time for a resource held briefly. A database connection is held only while the query runs. If queries take 10 ms of a 40 ms request, the pool needs 500 × 0.01 = 5 connections on average, not 20.
  • Measuring W at a different boundary. Client latency adds network time the server never sees. 40 ms of server time plus 30 ms of network gives L = 35 at 500 req/s, which oversizes a server-side pool by 75%.
  • Forgetting retries. Retries are arrivals. A 10% retry rate makes λ 550, not 500, and L 22 instead of 20, just when the system is already struggling.
  • Adding workers to a slow dependency. If W rose because the database is saturated, more concurrency sends it more work and raises W further. Fix the dependency or shed load.
  • Treating 80% as universal. A pool of two servers at 80% averages 2.8 times the service time; 24 servers at 83% average 1.07 times. Small pools need more headroom than large ones.

Check yourself

A queue holds 1,200 messages and consumers complete 300 a second. Assuming a steady state, how long does a message spend in the system?

W = L ÷ λ = 1,200 ÷ 300 = 4 seconds. If the queue length is rising, there is no steady state and the real wait is longer and growing.

A pool has 50 connections and each query holds one for 25 ms. What is the maximum throughput, and the throughput at 80% busy?

λ = L ÷ W = 50 ÷ 0.025 = 2,000 queries a second at 100%, and 1,600 at 80%. Past that, requests queue for a connection.

Traffic stays at 500 req/s but latency rises from 40 to 60 ms. What does the tool show for 24 servers, and what traffic can they sustain?

L = 500 × 0.06 = 30, so utilization is 125%: Over capacity. The ceiling is 24 ÷ 0.06 = 400 requests a second, and 320 at 80% busy.

Dashboards show 500 req/s, a 40 ms mean latency and an average of 45 requests in flight. What is wrong?

The law predicts 20. Forty-five in flight at 500 req/s implies 45 ÷ 500 = 90 ms per request, so the gauge and the latency metric measure different boundaries, such as a gauge that also counts queued requests, or the system is not in a steady state.

L = λ × W = 500/s × 0.04 s = 20 in flightarrivalsλ = 500/seach request stays W = 40 msleaving500/s20 of 24 slots busy: ρ = 83%, past the 80% line
The defaults as a picture. Whatever flows in at 500 a second and stays 40 ms leaves 20 requests inside on average, so 20 of the 24 slots are busy. Raise W or λ and more slots fill; the dashed ones are the only headroom left.

How it works

  • L = λ × W: concurrency = throughput × latency, with latency entered in milliseconds.
  • Solve for any one of the three from the other two.
  • Utilization ρ = L ÷ servers; 80% and above is flagged as hot, 100% as over capacity.
  • Exact for long-run averages of a stable system, not for bursts or tails.

Frequently asked questions

What is Little's Law?

Little's Law says that in any stable system, the average number of items inside it (L) equals the average arrival rate (λ) times the average time each item spends inside (W): L = λW. John Little published a general proof in 1961. It holds whatever the arrival pattern, service order or number of servers, which is why it underpins so much capacity planning. If 500 requests per second each take 40 ms, then 500 × 0.04 = 20 requests are in flight on average.

How do I use Little's Law to size a connection pool or thread pool?

Multiply peak throughput by the time each request holds a connection or thread, in seconds. That product is the average number of slots in use. Then divide by a target utilization so bursts have room: at 500 requests per second and 40 ms you need 20 slots on average, and 20 ÷ 0.75 rounds up to 27 slots at 75% busy. Too few and requests queue for a slot, which raises latency. Far too many wastes memory and can overload whatever sits downstream.

What does the utilization percentage mean?

It is the average concurrency L divided by the servers or workers you entered: the share of your slots in use. The tool marks under 80% as healthy, 80% to just under 100% as hot, and 100% or more as over capacity. Past roughly 80%, queueing delay grows quickly. In the simplest single-server queue model, the average time in the system is the service time divided by one minus the utilization, so 5 times the service time at 80% and 10 times at 90%.

How do I convert milliseconds for Little's Law?

Keep the units consistent: if throughput is in requests per second, latency must be in seconds. 40 ms is 0.04 seconds, so 500 requests per second times 0.04 seconds gives 20 requests in flight. Mixing units is the most common mistake, and it gives answers off by a factor of 1,000. This calculator takes latency in milliseconds and divides by 1,000 internally, and when it solves for latency it converts back to milliseconds, so you can type the numbers your dashboards show.

Does Little's Law work with p99 latency?

Not directly. The law is exact for averages: mean concurrency equals mean throughput times mean latency. Plugging in a p99 latency does not give you a p99 concurrency, but it does give a deliberately pessimistic size, as if every request were slow at once. A practical approach is to size from the mean with the law, then check that your headroom also covers peak traffic at tail latency, and treat the gap between the two numbers as your safety margin.

Why does Little's Law not match my metrics?

Usually because the three numbers are measured at different boundaries or over different windows. Latency measured at the client includes network and queueing time that the server's in-flight gauge never sees, and a short window during a burst is not a steady state. The law also needs a stable system: if requests arrive faster than they complete, the queue grows and the averages drift. Measure all three at the same point over the same period, ideally several minutes long, and the relationship should hold closely.