Guide

Capacity planning starts with demand. Two things drive it. The first is organic growth, the steady rise in users and traffic. The second is discrete events: launches, campaigns, seasonality and viral moments. A forecast that covers only the average misses both.

Concept

The peak-to-average ratio is peak load divided by average load over the same period. Many consumer APIs see peaks 2 to 5 times the daily average. Markets, games and chat can be much spikier.

Walking through a forecast

Write the forecast as a small table, and update it every month.

Horizon     Peak RPS   Notes
Now         2,400      Black Friday rehearsal last year: 3,100
+3 months   3,200      +10%/mo organic
Launch L    12,000     5x current peak; date T-0
Need @ L    15,000     5x + 25% headroom for AZ / deploys

The last row is the one that matters. A 5× launch on a 2,400 RPS peak is 12,000 RPS. Adding 25% headroom gives 12,000 × 1.25 = 15,000. The planning peak is 15,000, not the average.

If you cannot name the peak metric, you are not planning. You are hoping.

Turning marketing into load

Treat marketing as a load generator. An email to 2 million users with a deep link is not a vague event. It is a sharp arrival spike into a few endpoints. Ask for four things before the send.

  • The send time, so you know when the spike lands.
  • The expected click-through rate, which gives the arrival rate.
  • Whether the link is cacheable, which decides how much reaches the origin.
  • Which endpoints the link hits, so you know which tiers to scale.

Then stagger the sends, prefetch what you can, and pre-scale before the blast. Do not learn the shape of the spike from your pager.

Common mistakes

  • Planning on daily averages. The peak arrives at the worst time.
  • Not naming the peak metric. Requests per second, concurrent users and messages per second are different numbers.
  • Treating capacity as the app tier alone. Your capacity is the minimum of your tier and every synchronous dependency, such as the database, auth and payments.

Check yourself

  1. Your launch is 5× the current peak, and you want 25% headroom. What is the planning number for a 2,400 RPS peak? Answer: 15,000 RPS, from 2,400 × 5 × 1.25.
  2. Why is your capacity the minimum across dependencies? Answer: A slow or limited dependency caps the whole request path, however much the app tier can handle.

Key takeaways

  • Demand has two sources: steady growth and discrete events.
  • Plan against the peak and the peak-to-average ratio, not the average.
  • Convert each marketing event into an arrival rate and a set of endpoints.
  • Your capacity is limited by the weakest synchronous dependency.

Further learning

Next, see why latency rises so sharply as a system fills up: utilization and the knee.