Estimate capacity from the work users perform
Capacity estimation translates user activity into the rates and volumes a design must support. A user count becomes useful only after you specify what those users do, how much data each operation moves and the interval over which the activity occurs. Those assumptions connect a product requirement to a server, storage or network limit.
Estimate each resource from the operations that use it: reads drive serving capacity and response bandwidth, while writes drive storage growth and replication traffic. A cache can reduce the work that reaches an origin without reducing the number of user requests, so it changes one estimate and leaves the others alone.
Suppose one million daily active users each read 20 posts and publish two posts. Assuming one request per action, the service receives 22 million requests per day, about 255 per second on average. If a stated peak factor is five, peak demand becomes about 1,273 requests per second. Neither the request rate nor the peak factor follows from the user count alone.
Assume a server sustains 1,000 requests per second for this request mix at the target latency, a figure that should come from a load test. Planning at 70% of that measured capacity gives 700 usable requests per second per server. Two servers cover the estimated peak while both are healthy. Later in the lesson, losing one server tests whether that plan also meets a failure requirement.
1M daily users × (20 reads + 2 writes) per day ÷ 86,400 seconds254.6 average QPS; × 5 = 1,273.1 peak QPS; ceil(1,273.1 ÷ 700) = 2 serversCancel the units before rounding the answer
Dimensional analysis checks a calculation by following its units. Users multiplied by requests per user per day gives requests per day. Dividing by 86,400 seconds per day gives requests per second, often called QPS. Keeping units beside intermediate values catches a missing day-to-second conversion before it becomes a machine count.
The example produces 20 million reads and two million writes per day. Their average rates are 231.5 reads per second and 23.1 writes per second, which sum to 254.6 QPS. These are day-long averages; they do not describe the arrival pattern inside the busiest minute. A batch of a million requests arriving together creates a different queue from the same count spread evenly across a day.
Quick arithmetic is useful when its precision matches the decision. Rounding 86,400 to 100,000 gives 220 QPS here, about 14% below the more precise average, and both values still lead to two servers. The rounding matters once it moves a result across a boundary. With 1.2 million users, the precise peak is about 1,528 requests per second and needs three servers at 700 each, while the rounded estimate gives 1,320 and only two.
The fivefold peak factor is a separate assumption about arrivals. Time zones, scheduled jobs and launches can produce different peaks for reads and writes. Use observations when they exist; otherwise calculate a plausible range. If doubling the assumed peak changes the design, that assumption deserves measurement before purchasing capacity.
Conversions that make estimates quick
| Quantity | Value | Use it for |
|---|---|---|
| Seconds in a day | 86,400, about 10^5 | Daily counts to per-second rates |
| 1 million requests per day | about 12 per second | A quick sanity check on any daily figure |
| 1 billion requests per day | about 11,600 per second | Large consumer products |
| Seconds in a 30-day month | about 2.6 million | Monthly counts to per-second rates |
| Seconds in a year | about 31.5 million, about 3 × 10^7 | Yearly storage growth |
| 2^10, 2^20, 2^30, 2^40 | about 10^3, 10^6, 10^9, 10^12 (KB, MB, GB, TB) | Binary sizes to decimal arithmetic |
| One ASCII character | 1 byte in UTF-8; other scripts take 2 to 4 | Text fields such as names and URLs |
| A 64-bit integer id or timestamp | 8 bytes | Keys, foreign keys and time columns |
| A UUID | 16 bytes as binary, 36 characters as text | Choosing how to store identifiers |
| A 1 Gbps network link | 125 MB per second | Bandwidth in bytes from a link speed in bits |
Combine them by multiplying units. Two million posts a day at 1 KB each is 2 × 10^6 × 10^3 = 2 × 10^9 bytes, 2 GB a day; over a year that is about 730 GB before copies, indexes or backups.
Change one assumption at a time
Which results does each assumption move? Double the reads per user, then the writes, then the retention period and the number of copies, and compare peak QPS, bandwidth and stored bytes.
With the starting values, reads send about 37.0 megabits per second at peak. Writes create 2 GB of new logical data per day. Keeping 30 days needs 60 GB, and three total copies need 180 GB. Extra reads change neither storage figure because each write stores one record and reads store nothing.
Increasing peak traffic changes the serving requirement without changing the day’s stored volume. Increasing retention changes stored volume without changing incoming QPS. Those separate effects tell you whether to investigate serving capacity, bandwidth or storage.
Count durable records separately from responses
Storage accumulates retained data over time. Assume each new post stores 1 KB, with decimal units: 1 KB is 1,000 bytes and 1 GB is one billion bytes. Two million new posts per day create 2 GB of logical records per day. Retaining 30 days gives 60 GB; three total replicas, including the original, occupy 180 GB for those records.
Logical data size and physical storage differ. Index entries, transaction logs, backups and allocated free space add bytes, while compression may reduce them. A write that updates an existing post also has different long-term storage effects from an insert. The example assumes append-only posts retained for the full period, so its formula must change if the product permits replacements or early deletion.
Bandwidth measures bytes or bits transferred per unit time. With a 4 KB response and a fivefold read peak, the calculation is 231.5 reads per second × 5 × 4,000 bytes per response × 8 bits per byte, about 37 Mbps. This counts response payload only. Request bodies and protocol overhead need separate allowances if they materially affect the link.
The measurement boundary changes which traffic to count. An edge cache can serve a reader without contacting the origin, reducing origin traffic while the edge still sends the response to the reader. Replication and backups create internal traffic that a public-response estimate omits. For a photo service, image payloads may dominate both storage and delivery, so estimating only post metadata would size the wrong resource.
Size a cache from the hot set, not the whole dataset
A cache needs memory for the data that receives most reads, called the hot set, rather than for everything stored. In a social feed, most reads usually target recent posts. If readers mostly open posts from the last day, the hot set is one day of writes: two million posts. Caching the 1 KB records needs about 2 GB; caching the 4 KB rendered responses instead needs about 8 GB.
Add the cache server’s own overhead before choosing a machine. Each entry also stores its key and bookkeeping such as expiry time and eviction metadata, which matters most when values are small. If the cache is replicated for availability, multiply by the number of copies, and leave headroom so the server is not evicting hot entries during a traffic spike.
Then check what the database sees. If the cache serves 90% of the 1,157 peak reads per second, about 116 reach the database. When the cache restarts empty, all 1,157 do until it refills, so the database needs that capacity, or the application needs a limit on concurrent misses.
Attach each estimate to the resource it describes
| Quantity | Calculation | Assumption to challenge |
|---|---|---|
| Average requests/s | Users × actions per user ÷ 86,400 | One action makes one request |
| Peak requests/s | Average requests/s × peak factor | Reads and writes peak together |
| Payload bandwidth | Peak reads/s × bytes per response × 8 | No edge offload or protocol overhead |
| Logical retained storage | Writes/day × bytes per record × retention days | Each write creates a new retained record |
| Replicated storage | Logical storage × total copies | No indexes, backups or compression |
| Cache memory | Hot items × bytes per entry × cache copies | Reads concentrate on a known subset |
| Serving machines | Round up peak QPS ÷ usable QPS per machine | A measured workload with linear scaling |
Two servers cover the planned load; they do not survive losing one
Turn an estimate into a decision by naming the limit it tests. At the supplied per-server capacity, two servers provide 1,400 planned QPS against a peak of 1,273 QPS. That comparison supports a healthy serving-capacity claim for the modeled workload. It says little about database capacity or what happens when traffic is unevenly distributed.
If one of those two servers fails, the survivor receives more than its measured 1,000 QPS limit. To stay at or below the chosen 70% planning level after one failure, provision three servers: two survivors still provide 1,400 planned QPS. The spare capacity must already be usable if the requirement allows no interruption while a replacement starts.
The same calculation needs a larger failure unit when servers share a zone or another dependency. Three instances in one unavailable zone provide zero surviving capacity. Distributing instances helps only if the load balancer, database and other required services can also operate through the chosen failure. Availability is a property of the complete request path.
Finally, validate the per-machine number with representative payloads and a latency target. One server may handle many cache hits but far fewer expensive searches. Scaling can stop being linear when replicas contend on shared storage. Load tests should expose that limit, and observed request mix should feed back into the estimate.
What stays true
A capacity number describes one workload, unit and time interval. Change an assumption through its formula before changing the design.
Arithmetic errors that change the architecture
Using all requests as newly stored records.
- Where it breaks
- Twenty reads and two writes become 22 records per user per day, inflating storage elevenfold.
- The fix
- Estimate durable writes separately from reads and transient work.
Confusing MB/s with Mbps.
- Where it breaks
- A link sized for 37 megabytes per second is eight times larger than a 37 megabit per second payload estimate.
- The fix
- Write bytes or bits explicitly and multiply by eight when converting bytes to network bits.
Applying the peak multiplier to every day of stored records.
- Where it breaks
- A short fivefold traffic peak is counted as five times the whole day’s writes.
- The fix
- Use measured daily write volume for retention and a peak rate for short-term serving capacity.
Sizing a cache for the whole dataset.
- Where it breaks
- A year of posts, about 730 GB, is planned into memory although reads concentrate on the last day’s 2 GB.
- The fix
- Estimate the hot set from the read pattern, then add per-entry overhead and copies.
Treating spare capacity as failure redundancy.
- Where it breaks
- The two-server plan has headroom while both run, but the surviving server cannot handle peak traffic alone.
- The fix
- Recalculate the same peak with the required failure scenario, then test the bottleneck under that condition.
Use the numbers to test a design
Related topics
- Latency numbers →
Turn request counts into time: how long each operation takes on the critical path.
- Load balancing →
Distribute the calculated peak across servers with different request costs.
- Sharding →
Partition stored data when one machine no longer meets its capacity or throughput target.
- Caching strategies →
Choose what the hot set holds and how it stays fresh.
Further reading
- The System Design Primer: powers of two A powers-of-two table, latency numbers and worked estimates in a free, community-maintained guide. github.com (opens in a new tab)
- Google SRE Workbook: Non-Abstract Large System Design Back-of-the-envelope calculations used to test whether a design is feasible. sre.google (opens in a new tab)
- Google SRE: Handling Overload Capacity, request cost and serving behavior when load exceeds resources. sre.google (opens in a new tab)