Course map

Topic 102 / Advanced

Capacity planning

Chapter 6.5 · Performance Analysis

What and why

Little's Law and Amdahl's Law (→ 101) describe a system at a point in time; capacity planning is the ongoing process of making sure the system has enough capacity for where load is going, not just where it is now — a measured baseline, a growth projection, a headroom policy, and scheduled tests to confirm the projection still holds. Boundary: design-time estimation for a system that doesn't exist yet is → 20; capacity planning is the live, recurring version for a running system. Builds on: → 101 (Little's Law, queueing fundamentals and Amdahl's Law).

Diagram

measured baseline (current peak load, current per-instance throughput)
        │
        ▼
growth projection (apply a growth rate over a planning horizon)
        │
        ▼
headroom policy (target utilization ceiling, e.g. ≤ 70–80%, → 101)
        │
        ▼
instance count needed ──► provision ahead of need
        │
        ▼
scheduled load test (→ 199) ──► confirms or corrects the baseline

How it works

  1. Start from a measured baseline: actual current peak load and actual current per-instance throughput — never an assumed number, since theory and measurement routinely disagree, and the gap is exactly where under-provisioning hides.
  2. Project growth over a planning horizon using an observed growth rate, producing a future peak load estimate.
  3. Apply a headroom policy: divide the projected peak by a target utilization ceiling (not 100%) to get the required capacity — the same ceiling (→ 101) that keeps queueing delay off the steep part of its curve.
  4. Convert required capacity into an instance count using the measured per-instance throughput, round up, and add explicit failover headroom.
  5. Re-verify with a scheduled load test (→ 199) — a projection is a guess until it's tested against real traffic shape, and a wrong baseline assumption compounds directly into a wrong instance count.

Practical example

(numbers illustrative). Current peak = 500 QPS, growing 5%/month, planned 6 months ahead: projected peak = 500 × 1.05⁶ ≈ 670 QPS. With a 70% utilization ceiling, required capacity = 670 ÷ 0.7 ≈ 958 QPS. If a measured baseline shows each instance sustainably handles 50 QPS at that ceiling, instances needed = 958 ÷ 50 ≈ 19.2 → 20 instances. A scheduled load test later reveals the real per-instance throughput is only 40 QPS, not 50: recomputed instances needed = 958 ÷ 40 ≈ 23.9 → 24 instances — a 20% under-provisioning (20 vs. 24) the load test caught before production traffic did.

When to use it

  • Use capacity planning for any system whose load changes over time and whose under-provisioning has real cost; run it on a recurring schedule, not once at launch.
  • Avoid projecting growth from too short or too atypical a baseline window (a holiday spike, a one-off marketing event) as if it were the steady trend.
  • Failure scenarios: a growth rate measured during an unusually quiet period, badly underestimating a resuming trend; an assumed per-instance throughput that was never actually load-tested; a headroom policy with no failover margin, so losing one instance during a peak immediately breaches the ceiling instead of degrading gracefully.
  • Simpler alternative: for a small, slow-growing, non-critical system, periodic manual review against a comfortable fixed margin may be enough — formal projection-and-test cycles earn their cost once growth is fast or failure is expensive.

Practice

(numeric drills — 20 min; compute by hand, then verify).

  1. Current peak = 500 QPS, growth = 5%/month. Project the peak 6 months ahead.
  2. Using drill 1's result and a 70% utilization ceiling, find the required capacity.
  3. Using drill 2's result and a measured per-instance throughput of 50 QPS, find the number of instances needed (round up).
  4. A headroom policy adds 2 instances beyond drill 3's calculated need for failover. What percentage of extra capacity does this add?
  5. A load test later shows real per-instance throughput is only 40 QPS, not 50. Recompute the instances needed from drill 2's required capacity, and state the percentage under-provisioning the original 50-QPS assumption would have caused.

Answer key: (1) 500 × 1.05⁶ ≈ 670 QPS. (2) 670 ÷ 0.7 ≈ 958 QPS. (3) 958 ÷ 50 ≈ 19.2 → 20 instances. (4) 22 ÷ 20 = 1.10 → 10% extra. (5) 958 ÷ 40 ≈ 23.9 → 24 instances; (24 − 20) ÷ 20 = 20% under-provisioned.

Done when all five answers match the key.

Key takeaway

Capacity planning is the recurring cycle — measured baseline, growth projection, headroom policy, scheduled test — that keeps a live system ahead of its own growth; a wrong baseline is the single most common way it fails. Done when you can: project a future peak, convert it to an instance count with a stated headroom policy, and explain how a load test would catch a wrong assumption. Used next in → 103 (profiling, finding whether the real bottleneck matches the planned one), → 199 (load, stress, spike and soak testing).

References

None — this topic makes no external claims.

Source directory

Search the guide