Capacity Estimation — System Design Notes

Easy-to-understand, interview-oriented notes with ASCII diagrams
Demand RPS SLO Server Capacity Autoscaling

1. What is Capacity Estimation?

Capacity estimation answers one fundamental question:

“How much infrastructure do I need to handle the expected load while meeting my SLO?”
                    SYSTEM DESIGN
                         |
                         v
              +----------------------+
              | How much traffic?    |
              | How much data?       |
              | How much bandwidth?  |
              | How many servers?    |
              +----------+-----------+
                         |
                         v
                 CAPACITY ESTIMATION

It is essentially back-of-the-envelope calculation. Exact numbers are less important than reasonable assumptions, correct order of magnitude, and understanding the architectural consequences.

2. The Three Things You Need First

                CAPACITY ESTIMATION
                         |
          +--------------+--------------+
          |              |              |
          v              v              v
        SLO            DEMAND       INSTANCE
      Requirement      Traffic       Capacity
          |              |              |
       "How fast?"   "How much?"   "How fast
                                    is 1 server?"

A. SLO

Example: P90 latency ≤ 100 ms.

90% of requests
       |
       v
must finish within
       |
       v
    100 ms

B. Demand

Example: 2,000,000 requests/day.

2,000,000 ÷ 86,400 ≈ 23.1 RPS ≈ 24 RPS

C. Instance Capacity

Performance testing tells us how much work one instance can process while meeting the SLO.

1 server
   |
   +---- Request 1 --> 35 ms
   +---- Request 2 --> 35 ms
   +---- Request 3 --> 35 ms

3. Acceptable Backlog per Instance

Suppose:

  • SLO = 100 ms
  • Processing time per request = 35 ms
Acceptable Backlog / Instance = SLO ÷ Processing Time = 100 ÷ 35 ≈ 3
        +----------------+
        |    SERVER 1    |
        +----------------+
          |    |    |
          v    v    v
        Req1 Req2 Req3
          |    |    |
         35ms 35ms 35ms

        ≈ 3 requests

Think of this number as the approximate amount of work an instance can carry while still satisfying the latency objective.

4. The Two Numbers to Remember

                    CAPACITY
                       |
                       v
          Acceptable Backlog / Instance
                       |
                       v
              "How much CAN
               one server handle?"


                    DEMAND
                       |
                       v
              Backlog / Instance
                       |
                       v
              "How much LOAD
               is each server getting?"

Acceptable Load

SLO ÷ Processing Time

Actual Load

Demand ÷ Number of Instances

5. Calculate Number of Servers

                    Demand
                       |
                       v
              +----------------+
              |    24 RPS      |
              +-------+--------+
                      |
                      v
             Desired capacity
              per instance
                      |
                      v
                 ~3 RPS
                      |
                      v
              +---------------+
              | 24 / 3 = 8   |
              +---------------+
                      |
                      v
                 8 SERVERS
Required Instances = Demand ÷ Acceptable Load per Instance
InputValue
Demand24 RPS
Acceptable capacity / instance3 RPS
Required instances24 ÷ 3 = 8

6. Traffic Increase → Scale Out

Normal traffic:

Traffic = 24 RPS
Servers = 8
Load/server = 24 / 8 = 3
Target = 3

Actual = Target
      |
      v
   HEALTHY

Now traffic jumps to 96 RPS:

             96 RPS
                |
                v
        +---------------+
        | 8 servers     |
        +---------------+
                |
                v
          96 / 8 = 12

Acceptable = 3
Actual     = 12

12 > 3
  |
  v
SCALE OUT

Required capacity:

96 ÷ 3 = 32 servers

7. Autoscaling Feedback Loop

                    TRAFFIC
                       |
                       v
                +-------------+
                |   LOAD      |
                +------+------+
                       |
                       v
              Demand / Instances
                       |
                       v
             +-------------------+
             | Load / Instance   |
             +---------+---------+
                       |
                       v
                Compare with
                  target = 3
                       |
             +---------+---------+
             |                   |
             v                   v
          > 3                  < 3
             |                   |
             v                   v
        SCALE OUT           SCALE IN
             |                   |
             v                   v
      Add instances        Remove instances
             |                   |
             +---------+---------+
                       |
                       v
                  Recalculate

8. Traffic Falls → Scale In

Suppose traffic falls back to 24 RPS but we still have 32 servers:

24 ÷ 32 = 0.75 RPS/server
Actual load = 0.75
Target       = 3

0.75 < 3
   |
   v
SCALE IN
   |
   v
Eventually:
24 RPS / 8 servers = 3 RPS/server
   |
   v
HEALTHY

9. Complete Architecture View

             TRAFFIC
                |
                v
        +---------------+
        | Load Balancer |
        +-------+-------+
                |
        +-------+-------+
        |       |       |
        v       v       v
      EC2     EC2     EC2
       ...     ...     ...
                |
                v
        Measure traffic
                |
                v
       Demand / Instances
                |
                v
       Load per Instance
                |
                v
          +-----------+
          | Compare   |
          | with 3    |
          +-----+-----+
                |
        +-------+-------+
        |               |
      > 3              < 3
        |               |
        v               v
    SCALE OUT        SCALE IN
        |               |
        v               v
   Add servers      Remove servers

10. Don't Stop at RPS

                 CAPACITY ESTIMATION
                         |
       +---------+-------+--------+---------+
       |         |                |         |
       v         v                v         v
     Traffic   Storage         Bandwidth   Memory
       |         |                |         |
       v         v                v         v
      RPS       GB/TB            Mbps       GB
Traffic
Users, DAU/MAU, requests/day, average RPS, peak RPS
Data
Storage/day, storage/year, database growth
Network
Bandwidth, request/response payload sizes
Compute
CPU, memory, instances, per-instance benchmark
Database
Read/write ratio, QPS, replication, storage
Scaling
Horizontal scaling, autoscaling, peak factor

11. Interview Reasoning Flow

Business requirement
       ↓
Traffic assumptions
       ↓
Average RPS
       ↓
Peak RPS
       ↓
Per-server benchmark
       ↓
SLO / latency constraint
       ↓
Required capacity
       ↓
Number of servers
       ↓
Autoscaling strategy
Do not simply say: “We need 20 servers.”

Instead explain the assumptions and calculations that lead to the number.

12. One-Minute Interview Framework

             ┌─────────────────────┐
             │ 1. USERS            │
             │ DAU / MAU           │
             └──────────┬──────────┘
                        ↓
             ┌─────────────────────┐
             │ 2. REQUESTS         │
             │ requests/user/day   │
             └──────────┬──────────┘
                        ↓
             ┌─────────────────────┐
             │ 3. TRAFFIC          │
             │ Avg RPS → Peak RPS  │
             └──────────┬──────────┘
                        ↓
             ┌─────────────────────┐
             │ 4. DATA             │
             │ storage + bandwidth │
             └──────────┬──────────┘
                        ↓
             ┌─────────────────────┐
             │ 5. COMPUTE          │
             │ capacity/server     │
             └──────────┬──────────┘
                        ↓
             ┌─────────────────────┐
             │ 6. INFRASTRUCTURE   │
             │ servers/DB/cache    │
             └──────────┬──────────┘
                        ↓
             ┌─────────────────────┐
             │ 7. SCALE            │
             │ horizontal + auto   │
             └─────────────────────┘

13. Formula Cheat Sheet

CalculationFormula
Average RPSRequests/day ÷ 86,400
Peak RPSAverage RPS × Peak Factor
Acceptable load / instanceSLO ÷ Processing Time
Actual load / instanceDemand ÷ Current Instances
Required instancesPeak Demand ÷ Acceptable Load / Instance
StorageRecords × Record Size × Retention Period
BandwidthRPS × Average Payload Size

14. Quick Example to Memorize

Given:

  • 2M requests/day
  • P90 SLO = 100 ms
  • Request processing time = 35 ms

Step 1 — Average RPS

2,000,000 ÷ 86,400 ≈ 24 RPS

Step 2 — Acceptable load / instance

100 ÷ 35 ≈ 3

Step 3 — Required instances

24 ÷ 3 = 8 servers

Step 4 — Peak traffic at 4×

24 × 4 = 96 RPS

Step 5 — Peak instances

96 ÷ 3 = 32 servers

Architectural conclusion: design for horizontal scaling from approximately 8 instances at normal load to approximately 32 instances at the assumed peak, with autoscaling driven by load per instance and protected by sensible scale-out/scale-in policies.

15. Final Mental Model

              DEMAND
                 |
                 v
          How much traffic?
                 |
                 v
              PEAK RPS
                 |
                 v
       How much can ONE server
             handle?
                 |
                 v
          SERVER CAPACITY
                 |
                 v
      +-----------------------+
      | Required Servers      |
      |                       |
      | Peak RPS              |
      | -----------           |
      | Server Capacity       |
      +-----------+-----------+
                  |
                  v
             ARCHITECTURE
                  |
        +---------+---------+
        |         |         |
        v         v         v
      Cache      DB       Servers
        |         |         |
        +---------+---------+
                  |
                  v
             AUTOSCALING
One line to remember:
Capacity estimation = quantify demand + quantify per-unit capacity + respect the SLO + size for peak + translate the result into architecture.

16. Interview Checklist

  • Clarify the functional workload.
  • Estimate users and requests.
  • Convert daily traffic into average RPS.
  • Estimate peak RPS and state the peak factor.
  • Clarify latency/SLO requirements.
  • Use benchmark data for per-instance capacity where possible.
  • Calculate required instances.
  • Consider redundancy and failure scenarios.
  • Estimate storage and bandwidth.
  • Check database and cache capacity separately.
  • Explain horizontal scaling and autoscaling.
  • State assumptions explicitly.