ch16 · Power first
The question
What changes when watts are the binding constraint rather than money?
Everything so far has sized a system from demand, then priced what it sized. Here the sizing runs the other way. A rack has a power allocation. The allocation is not negotiable. The number of machines follows from it.
The material
Sizing backwards
When power binds, the chain inverts. You start with an allocation at the wall. You divide out what the building spends on itself. You divide by what a machine draws. Then you round down.
That rounding is the only one in this book that goes that way. Every other constraint is a demand to be satisfied, so it rounds up. This one is a supply that cannot be exceeded. Problem 16.1 is that inversion. People get the facility multiplier backwards: an inefficient building buys you fewer machines, not more.
Here is the same fleet on two axes:
On the left, watts against hosts, and a wall: what the building will supply, the largest whole number of hosts that stays under it, and the next one, which does not. On the right, the same hosts against what they cost over the horizon. It is a slope, and there is nothing across it to stop anybody. That is the difference between a constraint and a price, and the rest of this chapter is about what happens to the fleet the wall leaves you.
What a power budget does to a fleet sized for demand
| Output | Reference scenario | Sized from the power budget inwards |
|---|---|---|
| hosts the model recommends | 54 20 to 230 | 54 20 to 230 |
| hosts in the fleet | 54 | 36 |
| five-year total cost of ownership | $2,002,083 $1,508,230 to $2,923,724 | $1,617,743 $1,189,939 to $2,388,434 |
| cost per million requests | $1.82 $0.55 to $5.98 | $1.47 $0.44 to $4.84 |
| cost per stored TB per month | $839.64 $305.33 to $2,108 | $678.46 $244.15 to $1,707 |
| capex | $421,214 $272,130 to $658,773 | $280,810 $181,420 to $439,182 |
| annual opex | $316,174 $227,660 to $484,257 | $267,387 $186,962 to $413,526 |
| annual energy | 206,269 159,636 to 269,269 | 137,513 106,424 to 179,513 |
| utilisation at the busy hour | 0.644 0.156 to 2.48 | 0.966 0.234 to 3.73 |
| utilisation with one host down | 0.656 0.159 to 2.53 | 0.993 0.241 to 3.83 |
| working set against memory | 0.746 0.194 to 2.67 | 1.12 0.290 to 4.01 |
| disk fill at horizon | 0.670 0.213 to 2.12 | 1.00 0.320 to 3.18 |
| fraction of the fleet doing nothing useful | 0.321 0.213 to 0.457 | 0.224 0.139 to 0.337 |
| utilisation, counting coordination | 0.948 0.233 to 3.81 | 1.25 0.305 to 4.91 |
| utilisation | 0.644 0.156 to 2.48 | 0.966 0.234 to 3.73 |
| residence time | 0.0367 0.0128 to 0.857 | 0.383 0.0145 to 0.877 |
| time spent queueing | 0.0236 0.0021 to 0.839 | 0.370 0.0035 to 0.859 |
| requests in the system | 1,562 160 to 107,336 | 16,296 176 to 107,336 |
| requests in flight, if none waited | 556 135 to 2,147 | 556 135 to 2,147 |
| how much the queueing view understated it | 1.47 1.27 to 1.84 | 1.29 1.16 to 1.51 |
| fraction of the peak already built | 0.328 0.186 to 0.584 | 0.219 0.124 to 0.389 |
| working set against memory — over its limit | 35% | 55% |
| utilisation, counting coordination — over its limit | 48% | 61% |
| disk fill at horizon — over its limit | 29% | 51% |
| utilisation with one host down — over its limit | 30% | 49% |
| utilisation at the busy hour — over its limit | 30% | 48% |
| fraction of the fleet doing nothing useful — over its limit | 0% | 0% |
Source — web_service-reference and web_service-power_first · every input on a slider
The left column is the fleet ch12 recommended. The right is what fits in the allocation.
It is smaller. Everything downstream is smaller with it: less capital, less running cost, a lower total. Read those rows alone and the power-constrained design looks like a saving.
Then read the ceilings:
| Ceiling | At the plan | Headroom | Allowed | Limit | Verdict | Over allowed | Over limit |
|---|---|---|---|---|---|---|---|
| working set against memory | 1.12 | 25% | 0.75 | 1.00 | over | 68% | 55% |
| utilisation, counting coordination | 1.25 | 30% | 0.70 | 1.00 | over | 75% | 61% |
| disk fill at horizon | 1.00 | 25% | 0.75 | 1.00 | over | 66% | 51% |
| utilisation with one host down | 0.99 | 30% | 0.70 | 1.00 | into the margin | 66% | 49% |
| utilisation at the busy hour | 0.97 | 30% | 0.70 | 1.00 | into the margin | 64% | 48% |
| fraction of the fleet doing nothing useful | 0.22 | 50% | 0.50 | 1.00 | ok | 0% | 0% |
Source — web_service-power_first · every input on a slider
None of them is comfortable, and they are uncomfortable in different ways. Three are over their hard limit at the point estimate:
the working set no longer fits in the fleet’s memory;
the disks are full;
the fleet spends more of itself on coordination than its margin allows.
That is not an unlucky percentile. It is the expected case, and the model puts each of the three over in a large share of the futures it thinks plausible. The two queueing ceilings are still under their limit. But they have spent the whole margin that was keeping them there. That is what the verdict column means by into the margin rather than ok.
So the honest output of this chapter is not a fleet. It is the statement that this workload does not fit in this power envelope, with the numbers to say so.
That is a useful answer, and a spreadsheet does not produce it. Sized from a power budget, a spreadsheet gives a host count and stops. The host count is real. The fleet it describes cannot do the job it would be bought for.
Four ways out of a power budget that does not fit
Once the model says the workload does not fit, there are four things you can do. The model prices three of them.
Get more power. The expensive one, and often the slowest. A power allocation is a building’s property, and sometimes a substation’s.
Use less per machine. Fewer, denser machines change watts per machine and capacity per machine together. The model will say whether the trade is favourable.
Improve the building. ch15’s facility multiplier is a division. Problem 16.2 is that division, and the framing is the point: a multiplier quoted as a small surcharge is a substantial share of the bill. Halving the overhead is equivalent to finding machines that draw materially less, and it is often cheaper.
Want less. Shed the least valuable requests at the busy hour. Keep fewer records. Accept a longer tail. Nobody proposes this in a sizing meeting, and it is frequently the right answer.
Why power is not a price like the others
Every other cost in ch15 is a price: negotiable, comparable, subject to a discount. Energy is physics with a price attached.
| Input | Kind | annual energy at its p10 | at its p90 | Swing |
|---|---|---|---|---|
| host power | input | 172,746 | 246,502 | 73,756 |
| PUE | input | 185,101 | 234,411 | 49,310 |
| annual growth factor | input | 206,269 | 206,269 | 0 |
| contention | input | 206,269 | 206,269 | 0 |
| crosstalk | input | 206,269 | 206,269 | 0 |
| electricity price | input | 206,269 | 206,269 | 0 |
| fully loaded salary | input | 206,269 | 206,269 | 0 |
| host price | input | 206,269 | 206,269 | 0 |
Source — web_service-reference · every input on a slider
Four things move the energy bill: a count of machines, a draw per machine, a building multiplier and a tariff. Three of the four are properties of hardware and buildings, not of contracts. The one that is a price is set by a market nobody in the room influences.
Energy is also the only cost line that is a constraint at the same time. Nobody is told they may not spend more on hosts. People are regularly told the rack has no more power.
A note on carbon
The model does not carry a carbon figure. The omission is deliberate.
Converting energy to emissions needs a grid intensity. That varies by region, by hour, and by whatever contractual instruments an organisation has bought. Those instruments are an accounting decision, not a physical one. This book produces the kilowatt-hours, which is the part it can defend. Multiplying them is somebody else’s judgement, and the multiplier is where all the disagreement is.
Energy price and carbon price move together (ch14). A model that added a carbon line and drew it independently would understate the range of the total.
Key takeaways
When power binds, the chain runs backwards and rounds down. Start at the wall, divide out what the building spends on itself, divide by what a machine draws, and take the whole number below.
A fleet that fits the allocation can fail to do the job. Sized to the power budget, the running example is over three hard limits at the point estimate and has spent the margin on the other two.
The honest output is a statement that the workload does not fit, with the numbers to say so. A spreadsheet sized from a power budget gives a host count and stops.
There are four ways out, and the model prices three of them. More power, less per machine, a better building, or wanting less. The last is rarely proposed and often right.
Energy is the one cost that is also a constraint. Nobody is told they may not spend more on hosts. People are regularly told the rack has no more power.
What this cannot tell you
What your allocation is. Contracted power, breaker capacity, cooling capacity and what the facility will let you draw sustainably are four different numbers. They are not usually the same one. This chapter takes one number. Getting the right one is a conversation with whoever runs the building.
What a machine draws. The model uses a typical figure under load, marked as a vendor’s claim. Draw varies with workload, with ambient temperature, and with how busy the processors are. The number that matters for an allocation is a sustained peak, not a typical figure.
Anything about the shape of the draw. Power is billed on energy and constrained on peak. A fleet that idles overnight and saturates at noon has an energy bill of one shape and a capacity problem of another. This model has only the average.
Whether the building’s multiplier is stable. It varies with outside temperature and with how full the facility is. The figure quoted in a contract is usually an annual average under favourable assumptions.
What to do about it. The model prices three of the four responses above. Which to choose is a decision, and ch21 is about putting one to somebody.
Problems
Three, in tests/power_first/. The first two have tests. The last does not, and says why.
16.1 — Sizing backwards. From an allocation to a machine count. Get the multiplier the right way up, and round the way a supply rounds rather than the way a demand does.
def hosts_that_fit(budget_kw: float, watts_per_host: float, pue: float) -> int:
"""Problem 16.1 - sizing runs the other way when power is the constraint.
``budget_kw`` is the power allocation, at the wall. ``watts_per_host`` is what one machine
draws. ``pue`` is the facility multiplier - what the building spends on cooling and losses for
every watt the machines use.
Return how many whole machines fit in the allocation.
Two things to get right. The multiplier applies to the machines' draw and not the other way
round, so a rack full of efficient machines in an inefficient building buys you fewer of them,
not more. And you round **down** - every other rounding in this book goes up, because every
other constraint is a demand to be satisfied, and this one is a supply that cannot be
exceeded.
"""
raise NotImplementedError("problem 16.1")The same check at a desk: python3 -m pytest tests/power_first/test_problem_1_budget.py -m problem
16.2 — A ratio quoted, a fraction paid. One line, worth having in your head. A building that sounds a little inefficient is spending a substantial share of the bill on itself. The two framings land very differently in a conversation about money.
def pue_premium(pue: float) -> float:
"""Problem 16.2 - what the building costs, as a fraction of the bill.
Return the share of the electricity bill that goes to the facility rather than to the
machines, as a number between zero and one.
It is one line and it is worth having in your head, because a facility multiplier is quoted as
a ratio and paid as a fraction, and the two feel different. A building quoted as half again
over the machines is spending a third of the bill on itself.
"""
raise NotImplementedError("problem 16.2")The same check at a desk: python3 -m pytest tests/power_first/test_problem_2_pue.py -m problem
16.3 — What you are actually allowed to draw. No test: the numbers are held by people, not by this repository.
Find out your real power allocation, and find out who knows it. Contracted supply, breaker capacity, cooling capacity and what the machines currently draw are four different numbers. The smallest is the one that sizes you.
Expect this to be hard. In most organisations the people who plan capacity and the people who hold the power contract have never been in the same meeting. The constraint that binds first is owned by neither.
A good answer has four numbers, or has fewer and names who would have to be asked for the rest. If you already knew all four without asking anybody, you are in an unusual organisation, and the rest of this chapter is easier for you than for most readers.
Where to go next
ch17 turns a total into a number somebody outside the team can compare against something. That is where a power-constrained design either justifies itself or does not.
ch14 is why an energy price and a carbon price should not be drawn independently.