Capacity math
Capacity math
Silver
Capacity math turns a peak load into the resources to provision — what each resource carries at that peak (CPU, connections in use, the database's connection limit), kept below its knee, with a spare for a lost server. The first resource to run out is the bottleneck, and a load test checks the estimate.
- Use when
- Before a predictable peak — a launch, a campaign, the daily rush · Choosing server counts, pool sizes and database limits together · Checking whether a design can carry a target load before building it
- Avoid when
- Instead of a load test — the estimate is where testing starts
- Trade-offs
- Headroom and spare servers cost money every hour they sit idle · Too little capacity costs performance; too much costs money
- Requires
- Connection pools, Server capacity & scaling up
3 objectives · 10 misconceptions
- predict Estimate how many servers a peak needs — the peak divided by what one server handles at a target utilization below the knee, plus enough spare to lose one.
- predict For a planned peak, work out what each resource carries — CPU, connections in use, the database's total connections — and name the one that runs out first.
- choose Choose what to size for — the peak rather than the average, a target utilization with headroom, the loss of a server — and explain why a load test has to confirm the estimate.
- Not true: Sizing for the average load is enough, because peaks are short.
- Not true: A server's capacity is what it serves at 100% busy, so plan right up to that.
- Not true: Exactly enough servers to carry the peak is the right number.
- Not true: Capacity math is about CPU; the other resources follow along.
- Not true: Adding app servers adds capacity all the way down, database included.
- Not true: A careful calculation makes a load test unnecessary.
- Not true: Capacity is worked out once, before launch.
- Not true: A server whose average utilization looks moderate is never briefly at 100%.
- Not true: The servers that take the traffic first are the ones that run out first.
- Not true: When a server fails, the others keep only their own share of the traffic.