Learn
Lesson · Queues and Utilisation · Shedding and overload

Transient Overload and Draining the Backlog

Every formula so far assumed a steady state. A spike above μ has none: it accumulates a backlog equal to the area of λ − μ over its duration, and that area drains afterwards at whatever headroom is left. A sixty-second spike can be a three-and-a-half-minute incident, and the worst lag arrives at the moment the spike ends.

backlog = area of (λ − μ) over the spike 500/s × 60 s = 30 000 drains at the headroom μ − λ_after 1000 − 800 = 200 / s drain time = backlog ÷ headroom 30 000 ÷ 200 = 150 s worst lag = backlog ÷ μ 30 000 ÷ 1000 = 30 s total episode = 60 + 150 = 210 s three and a half times the spike
An area, and the two divisions that drain it

Core ideas

What this lesson establishes

Three quantities, each a division of the same area, and none of them is a steady state.

1

A backlog is an area, not a rate

While λ > μ the amount waiting grows at λ − μ per second, so the total left at the end of the spike is that excess multiplied by how long it lasted. Two spikes with the same peak and different durations leave completely different backlogs, and the peak alone does not predict the incident.

2

It drains at the headroom, not at μ

Once the spike ends the consumer is still receiving λ_after, so only μ − λ_after per second is available to work through the backlog. Headroom, again: the same quantity the knee was a function of, doing the same job in a different form.

3

The lag peaks when the spike ends

Consumer lag — how far behind the newest message the reader is, in time — is the backlog divided by μ. It rises throughout the spike, reaches its worst at the instant the arrival rate returns to normal, and only then starts to fall. Latency does not recover when the spike ends; it recovers when the area does.

The material

The area a spike leaves behind

What accumulates, what drains it, how long that takes, and why the worst moment is after the surge is over.

Definition · The episode

A system drains at μ. The arrival rate is λ_before until the spike, λ_spike for d seconds, then λ_after. The excess is λ_spike − μ, the peak backlog is that excess times d when positive and zero otherwise, the headroom afterwards is μ − λ_after, and the drain time is the backlog divided by the headroom.

Two conditions are worth checking before any of it: the system must have been stable before the spike, or the backlog did not start at zero; and the headroom afterwards must be positive, or there is no drain time at all and the backlog is permanent.

μ = 1000 / s λ_before = 800 / s λ_spike = 1500 / s for d = 60 s λ_after = 800 / s excess 1500 − 1000 = 500 / s peak 500 × 60 = 30 000 waiting, at the end of the spike headroom 1000 − 800 = 200 / s drain 30 000 ÷ 200 = 150 s lag 30 000 ÷ 1000 = 30 s the worst a consumer is behind total 60 + 150 = 210 s

A minute of overload, three and a half minutes of incident. The asymmetry is entirely in the two rates: work arrived 500 a second faster than it could be handled and leaves only 200 a second faster, so every second of the spike costs two and a half seconds of recovery.

That ratio is the useful generalisation: the recovery is excess ÷ headroom times the length of the spike. Systems run close to μ have very little headroom, so their recovery multiplier is large — another form of the knee, and another reason a target utilisation is chosen rather than a maximum one.

What the consumer sees

The backlog rises linearly to 30 000 at t = 60, then falls linearly to zero at t = 210, so at t = 30 it is 15 000 on the way up and at t = 135 it is 15 000 again on the way down. Lag follows the same shape divided by μ: nothing, then thirty seconds at the moment the surge ends, then a slow return. An alert on lag fires late in the spike and clears long after it, which is exactly what the arithmetic says should happen.

Example · A spike with nowhere to drain

Keep everything the same but let the arrival rate return to 1000 rather than 800. The headroom is now zero, the drain time is undefined, and the 30 000 that accumulated is permanent: the system is stable in the sense that the backlog stops growing, and the lag stays at thirty seconds for ever. Recovery is not a property of a spike ending; it is a property of the headroom that follows it.

Example · A spike that is not one

A surge to 900 a second against μ = 1000 builds nothing at all, however long it lasts. There is no excess, so there is no area. What that surge does do is raise ρ from 4/5 to 9/10, which the knee says multiplies the response time by two — a real effect, and a different one from a backlog.

The controls are the familiar ones, in a new arrangement. More headroom shortens the drain and every other quantity on this page. A bounded queue or a token bucket caps the area by refusing part of the spike, trading the backlog for loss. And smoothing the arrivals — the variability lesson's c_a² — reduces how much of a surge is a spike at all.

This is also the lesson that says when the rest of the course applies. Every steady-state formula here describes a system whose load has been constant long enough to settle; during a spike, none of them is true, and the honest calculation is the area. Afterwards they become true again, which is what the drain time is measuring — the time until the model's assumption is met.

Interactive

Transient overload and the backlog

A spike is an area, and the drain is longer than the spike

Transient overloadthe area a spike leaves behind, and how long it takes to give it back
λ(t)μbacklogconsumer lag

Method

Working out an overload episode

Everything is one area and two divisions, in this order.

1

Check the system was stable before the spike

λ_before < μ. If it was not, the backlog did not start at zero and the peak is larger than the area of the spike alone.

2

Compute the excess and multiply by the duration

(λ_spike − μ) × d is the peak backlog, and it occurs at the end of the spike rather than at its start. A negative excess means no backlog at all.

3

Compute the headroom afterwards

μ − λ_after. If this is zero or negative, stop: there is no drain time, and the backlog is permanent until something else changes.

4

Divide twice

Backlog over headroom is the drain time; backlog over μ is the worst lag. The total episode is the spike plus the drain.

5

Compare the total with whatever it is measured against

A retention window, an alerting threshold, a customer's patience. The answer that matters is rarely the peak backlog itself but the time the system spends away from normal.

Areas, drains and lag

Score 0 / 0

A sixty-second spike, and the three minutes after it

A consumer that drains a thousand a second, a steady eight hundred, and one minute at fifteen hundred.

μ = 1000 / s λ_before = 800 / s stable before: 800 < 1000 ✓ λ_spike = 1500 / s for 60 s λ_after = 800 / s excess 1500 − 1000 = 500 / s peak 500 × 60 = 30 000 reached at t = 60 s headroom 1000 − 800 = 200 / s drain 30 000 ÷ 200 = 150 s total 60 + 150 = 210 s worst lag 30 000 ÷ 1000 = 30 s also at t = 60 s backlog at t = 30 15 000 rising backlog at t = 60 30 000 the peak backlog at t = 135 15 000 falling backlog at t = 210 0 recovered

The two halves of the episode are not symmetric and nothing makes them so. The backlog is built at 500 a second and removed at 200, so it takes two and a half times as long to leave as it took to arrive.

Note where the worst lag sits: at t = 60, the instant the arrival rate returns to normal. A dashboard watched during the surge shows lag still climbing as the traffic falls, which is confusing only if the backlog is being thought of as a rate rather than as an area.

For a faded rehearsal, keep everything but let the spike last thirty seconds instead of sixty. The supplied first move is that the excess is unchanged at 500 a second, so the peak halves. Predict the drain time, the worst lag and the total episode before computing them.

Common mistakes

1
Expecting latency to recover when the spike endsThe spike ending stops the backlog growing. Removing it takes backlog ÷ headroom, which on the worked example is two and a half times as long as the spike itself. The worst moment of the incident is the first moment of the recovery, and an alert that clears when traffic normalises is clearing early.
2
Sizing from the peak rate instead of the areaTwo spikes with the same peak and different durations leave different backlogs, and it is the backlog that sets the lag and the drain. Multiply the excess by the duration; a very high spike for two seconds may be a smaller event than a mild one for ten minutes.
3
Using a steady-state formula during the surgeW = S/(1 − ρ) describes a system that has settled, and a system with ρ > 1 has not and will not. During the spike the honest calculation is the accumulating area; the steady-state results become applicable again only once the backlog has drained.

Check your understanding

✓
Finish when a spike reads as an area with a recovery multiplier attached to it.

You should be able to compute the peak backlog, the drain time, the worst lag and the total episode from a piecewise arrival rate, say when there is no drain time at all, and explain why the steady-state formulas of this course do not apply while it is happening.

Note: That closes the four controls and the course. Every number here has been a consequence of ρ and of how irregularly work arrives; the next course changes λ at the source instead. “Caching and Hit Rates” asks what a cache is worth, and the answer is that a hit rate of h sends (1 − h)λ to the backend — a utilisation problem wearing different clothes.

Kept in this browser only, for you. Nothing is sent anywhere and nothing checks it. Carry it to another device.

Feedback and recommendations

Something to change about this lesson? Write it down, tick it off when it is handled, and export the list when you want to act on it. Kept in this browser only: nothing is sent anywhere, and nobody is notified.

No recommendations yet for this lesson.