Topic 020 / Core
Estimation and workload modeling: read/write ratio, QPS, peak and burst traffic, concurrent users, storage, bandwidth, user geography
Chapter 2.3 · Estimation and Workload Modeling
What and why
A design can't be sized or cost-justified without numbers — "it should be fast" and "it should scale" aren't inputs an architecture can be built from. Estimation and workload modeling turns a user count and usage pattern into concrete traffic, storage and bandwidth numbers, with every assumption stated, used to size components before building them. Builds on: → 19 — estimation applies the same order-of-magnitude discipline, now to load instead of time.
Diagram
| Input | Formula | Output |
|---|---|---|
| DAU × actions/user/day | ÷ 86,400 s/day | mean QPS |
| mean QPS × peak factor | — | peak QPS |
| total QPS × read/write ratio | — | read QPS, write QPS |
| arrival rate λ × avg time in system W | Little's Law, L = λW (→ 101) | concurrent users/requests |
| writes/day × avg payload size | × 365 | storage growth/year |
| reads/day × avg payload size | ÷ 86,400 s/day | mean bandwidth |
| where the users are | — | region split, CDN/replica placement (→ 94, 142) |
How it works
- Start from a usage count (DAU, MAU, or an already-measured request rate) and actions per user per day.
- Compute mean QPS = total actions/day ÷ 86,400 seconds.
- Apply a peak factor for known spikes (launch hour, lunch rush) to get peak QPS — burst traffic is the short, sharp version of this, sized separately when it's a distinct event (a flash sale) rather than a daily pattern.
- Split QPS by read/write ratio — most systems read far more than they write, and the ratio drives caching (→ 83) and replication (→ 72) strategy.
- Estimate concurrent users or requests with Little's Law (→ 101) when arrival rate and time in system are known.
- Compute storage growth per year from writes/day × average record size, and bandwidth from reads/day × average payload size.
- Factor in user geography — where the users are decides whether one region suffices, or traffic must be routed and replicated globally (→ 94, → 142).
- State every assumption used, and mark which are guesses vs. measured.
Practical example
(illustrative — see drill 5 below for the full worked numbers). A photo-sharing app's design-time estimate walks every row of the formula table above, from DAU down to a region split — the complete worked arithmetic is drill 5 in the Practice section, because an estimation topic lives or dies on correct numbers, not prose.
When to use it
- Use when: a system's scale isn't yet obvious, before infrastructure is chosen.
- Avoid when: chasing false precision — an estimate's job is the right order of magnitude (1 server or 100?), not a number trusted to three significant figures.
- Failure scenarios: sizing a database for mean load and falling over the first time traffic triples at peak, because no peak factor was ever applied.
- Simpler alternative: if the system already runs, use measured numbers and capacity planning (→ 102) instead of estimating from scratch.
Practice
(Numeric kind — five drills with an answer key; 20–30 min, no lab services).
- Read/write ratio & QPS. A system has 5M DAU, averaging 10 reads and 2 writes per user per day. Compute mean read QPS, mean write QPS, and the read/write ratio.
- Peak traffic. Using the mean read QPS from drill 1, what is the peak read QPS if the peak factor is 4×?
- Concurrent requests (→ 101). A service receives requests at λ = 2,000/sec with a mean time in system W = 150 ms. Estimate the average concurrent in-flight requests, L = λW.
- Storage growth. A service writes 1M records/day, each 2 KB. Compute storage growth per year.
- Full workload model, including geography. A photo-sharing app has 10M DAU, 2 uploads/user/day, 2 MB/photo. Compute: (a) mean and peak (×3) write QPS, (b) storage growth per year, (c) mean egress bandwidth if each photo is viewed 20 times. State at least three assumptions, including one about user geography.
Answer key.
- Reads/day = 5,000,000 × 10 = 50,000,000; writes/day = 5,000,000 × 2 = 10,000,000. Mean read QPS = 50,000,000 / 86,400 ≈ 578.7 qps. Mean write QPS = 10,000,000 / 86,400 ≈ 115.7 qps. Read/write ratio ≈ 5 : 1.
- 578.7 × 4 ≈ 2,315 qps.
- L = 2,000 × 0.150 = 300 concurrent requests.
- 1,000,000 × 2 KB = 2,000,000 KB = 2,000 MB ≈ 2 GB/day; × 365 ≈ 730 GB/year.
- (a) Uploads/day = 10,000,000 × 2 = 20,000,000. Mean write QPS = 20,000,000 / 86,400 ≈ 231.5 qps; peak (×3) ≈ 694.4 qps. (b) Bytes/day = 20,000,000 × 2 MB = 40,000,000 MB = 40,000 GB = 40 TB/day; × 365 ≈ 14,600 TB ≈ 14.6 PB/year. (c) Views/day = 20,000,000 × 20 = 400,000,000; egress bytes/day = 400,000,000 × 2 MB = 800,000 GB = 800 TB/day; in bits/sec: 800 × 10¹² bytes/day ÷ 86,400 s/day × 8 bits/byte ≈ 74.1 Gbps mean egress. Assumptions (three, one on geography): uploads and views are spread evenly across 24 hours for this mean calculation (peaks are handled separately via the peak factor); sizes use decimal units (1 TB = 10¹² bytes); users are spread across roughly 3 regions of similar size, so no single region needs to absorb more than ≈1/3 of peak write QPS — a split that drives the regional routing and replica-placement decisions in → 94 and → 142.
Done when your numbers match the answer key and every number carries its stated assumption.
Key takeaway
Estimation turns a usage count into QPS, storage, bandwidth and concurrency numbers, with every assumption stated — it answers "how big" before a line of infrastructure is chosen. Done when you can produce a full workload model like drill 5 from a one-line prompt in under 15 minutes. Used next in → 21 (trade-offs weigh against these numbers), → 94 / → 142 (geography-driven routing), → 102 (ongoing capacity planning).
References
None — this topic makes no external claims.
Source directory