Learn
Lesson · Capacity Estimation · Scale and shape

Peak to Average

A daily total divided by 86 400 is a real number about a system and it is not the number to build for. Traffic has a shape, and the ratio between the busiest hour and the average one is a property of that shape: flat for an internal service, a factor of two or three for a consumer app with an evening, far more for anything driven by a broadcast. You pay for the mean and you build for the peak, and nothing but the profile says how far apart they are.

mean rps = daily total / 86 400 peak rps = busiest bucket / 3 600 peak/mean = 24 · busiest bucket / daily total two integers 456 000 000 req/day, busiest hour 46 000 000 at 21:00 mean 5 277.78 req/s peak 12 777.78 req/s ratio 46/19 = 2.421× short by 7 500 req/s at the peak
Peak, mean, and the multiplier between them

Core ideas

What this lesson establishes

One hard idea: the provisioning multiplier is measured, not assumed. The other two concepts are what it is measured from and what happens when it is assumed instead.

1

You pay for the mean and you build for the peak

The bill over a day is set by the total, which is the mean rate times 86 400. Whether the system stays up is set by the busiest hour. Those are different numbers about the same day — here 5 277.78 and 12 777.78 requests a second — and confusing them produces a system that is correctly sized for a day that never happens.

2

The multiplier comes out of the profile

Peak over mean is 24 times the busiest bucket over the day’s total: two integers, and no rule of thumb anywhere in it. A consumer app with one evening peak gives 46/19, about 2.421×. Flatten the same day completely and the ratio is exactly 1. A broadcast where a single hour carries the day gives 26/3, about 8.667×. The number is a fact about the traffic and it has to be looked up.

3

Sizing to the mean is short by the difference, every day

At 5 277.78 a second of capacity against a peak of 12 777.78, the shortfall is 7 500 requests a second — not occasionally, but for an hour every day, at the hour that matters most. The failure is predictable and dated, which is what distinguishes it from the kind of overload that arrives as a surprise.

The material

A day with a shape, and the two rates you can read off it

What a profile is, how the peak and the mean come out of it, and what the ratio between them is a fact about.

Definition · Daily profile

A daily profile is the request count in each of the twenty-four hours of a day. Its mean rate is the daily total over 86 400 seconds; its peak rate is the busiest bucket over 3 600 seconds. The provisioning multiplier is the ratio of the two.

Both rates are computed from the same twenty-four numbers and neither is more real than the other. The mean is what the day cost; the peak is what the day required. A capacity estimate that reports one without the other has answered half a question, and usually the half that does not determine whether the system works.

daily total 456 000 000 req/day ÷ 86 400 s/day mean 5 277.78 req/s busiest bucket (21:00) 46 000 000 req/hour ÷ 3 600 s/hour peak 12 777.78 req/s peak / mean = 24 · 46 000 000 / 456 000 000 = 46/19 = 2.421× shortfall = 12 777.78 − 5 277.78 = 7 500 req/s

The middle line is worth dwelling on. Peak over mean is 24 · peak bucket / daily total — both ends integers, so the multiplier is an exact fraction and is completely independent of how big the day is. Double every bucket and the ratio does not move; change the shape of the day and it does. The multiplier is a statement about shape and nothing else.

Example · A consumer app with an evening

Twenty-four buckets rising to 46 000 000 requests at 21:00 and falling to 10 000 000 in the quiet hours; 456 000 000 requests over the day. The mean is 5 277.78 a second, the peak is 12 777.78, and the multiplier is 46/19. Anyone who sized this system from the daily total alone has built for 5 277.78 and will be 7 500 requests a second short every evening.

Two point four is not a rule

It is this profile’s answer. Flatten the shape in the lab — an internal service with no daily rhythm — and the multiplier falls to exactly 1, because the peak bucket is the mean bucket. Switch to the broadcast example, where one hour carries the day, and it rises to 26/3, about 8.667×. Three systems, one arithmetic, multipliers an order of magnitude apart.

So the estimate to distrust is the one that says “call it 2× for peak”. The multiplier is one of the few figures on this course that can be measured directly and cheaply from data the system already produces, and a measured one collapses a factor that would otherwise be carried as a ranged guess all the way to the machine count.

What an hourly bucket cannot see

The peak this profile reports is the busiest hour, which is itself an average over 3 600 seconds. A five-minute burst inside that hour is flattened by the bucket and does not appear. So the multiplier computed here is a lower bound on the one a finer profile would give: bucket the same day by minute and the peak can only rise or stay the same, never fall.

That is the assumption to say out loud whenever this number is quoted. “Peak over mean is 2.421, measured hourly” is a complete statement; without the last two words it is a claim about a resolution nobody chose deliberately. Where the burstiness inside a bucket is the thing that matters, the tools are in “Queues and Utilisation” — this lesson is about the shape of the day, not the shape of a minute.

One more thing the profile does not carry: the read/write mix moves with it. A daily ratio of 100:1 can be a different ratio in the busiest hour, and the rates that get sized are the peak-hour ones. If the profile is being measured anyway, it costs nothing to bucket the two request kinds separately and find out.

Interactive

Peak to average

The provisioning multiplier comes from the profile

The daily profiletwenty-four buckets; you pay for the mean and build for the peak
the busiest hourthe hour you are editingthe mean hour

Method

Getting a provisioning multiplier from traffic

Bucket the day, take both rates, divide, and say what resolution you used.

1

Bucket a real day rather than reasoning about one

Twenty-four counts from a log or a metric is usually an afternoon of work and removes a factor from the estimate that would otherwise be guessed. It is also the one input on this course that a running system will simply hand you.

2

Compute the mean, and label it as what you pay for

Daily total over 86 400. Write “mean” next to it, not “the rate”. Most of the damage this lesson is about comes from a figure that was correctly computed and then carried forward under a name that does not say which rate it is.

3

Compute the peak from the busiest bucket

Busiest bucket over 3 600. This is the figure that goes into “From a Request’s Cost to a Machine Count”, and it is the only one of the two that decides whether the system stands up.

4

Divide, and keep the ratio as the transferable part

24 · peak bucket / daily total. The multiplier is independent of the size of the day, so it stays valid as the system grows and can be applied to a forecast total years later, which the two rates cannot.

5

State the bucket width alongside the number

An hourly peak is an hourly average, and a finer bucket can only raise it. Quoting the multiplier with its resolution is what keeps it from being read as a hard ceiling on demand.

Peaks, means and multipliers

Score 0 / 0

456 million requests a day, with an evening peak at 21:00

One day, twenty-four buckets, and the three figures that come out of them.

quietest hours 10 000 000 req rising from 03:00 busiest hour (21:00) 46 000 000 req daily total 456 000 000 req mean rate 456 000 000 / 86 400 = 5 277.78 req/s peak rate 46 000 000 / 3 600 = 12 777.78 req/s multiplier 24 · 46 000 000 / 456 000 000 = 1 104/456 = 46/19 = 2.421× sized to the mean, at the peak: 12 777.78 − 5 277.78 = 7 500 req/s short for an hour, every day same arithmetic, other shapes: flat internal service = 1× broadcast, one hour carries the day = 26/3 = 8.667×

The multiplier line is the one that generalises. 46/19 is an exact fraction of two integers and it does not depend on the size of the day at all: scale every bucket by ten and it is still 46/19. That is what makes it the figure worth recording and reusing, while the two rates go stale as soon as the system grows.

The shortfall line is the one that makes the case. 7 500 requests a second is not an outage risk in the abstract; it is a scheduled one, at a known hour, with the same size every day.

For a faded rehearsal, use the lab’s broadcast example. The supplied first move is that only one bucket is lifted, so the daily total is 23 quiet hours plus one large one. Predict whether the multiplier will be nearer 3 or nearer 9 before you look, then read off the peak, the mean and the ratio — and say what sizing that system to its mean would cost.

Common mistakes

1
Sizing to the daily total over 86 400It is a correctly computed number and it is the mean, which is the rate the system experiences at no particular moment. Here it is 5 277.78 requests a second against a peak of 12 777.78, so a fleet built to it is 7 500 requests a second short for an hour every evening. What makes this mistake so durable is that the figure is right; only its name is wrong.
2
Using a remembered multiplier instead of a measured one“Call it 2× for peak” gets 2.421 roughly right for one consumer app, gives 1 for a flat internal service and is out by more than four times for a broadcast at 26/3. The multiplier is a fact about a particular day’s shape, it is cheap to measure from data the system already emits, and measuring it removes one of the few factors in a capacity estimate that does not have to stay a guess.
3
Reading the hourly peak as the real peakThe busiest bucket is an average over 3 600 seconds, so a burst lasting a few minutes inside it has been flattened before the multiplier was computed. Re-bucket the same day more finely and the peak can only rise. An hourly figure is therefore a lower bound on the demand, and quoting it without its resolution turns a floor into an apparent ceiling.

Check your understanding

✓
Finish when a request rate quoted without saying peak or mean reads as ambiguous rather than adequate.

You should be able to take twenty-four bucket counts to a mean, a peak and an exact multiplier, say why the multiplier is independent of the size of the day, state the shortfall that sizing to the mean would produce, and name the resolution your peak was measured at.

Note: The peak is now a number, and a number of requests per second is one input short of a fleet. “From a Request’s Cost to a Machine Count” supplies the other two — what one request costs and how full you are willing to run — and turns all three into an integer, which is the first answer on this course that cannot be a range.

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.