How do you estimate bandwidth, cache size and the number of servers?
MediumConceptBack-of-the-Envelope Estimation
Answer
Derive each from the QPS and data-size estimates: bandwidth is QPS multiplied by response size, cache size follows from the hot fraction of daily data, and server count is peak QPS divided by per-server capacity.
- Bandwidth: 12,000 read QPS at 100 KB per response is about 1.2 GB/s of egress, a strong signal for a CDN.
- Cache: using the 80/20 rule, caching the hottest 20% of 10^9 daily reads of 1 KB objects needs about 200 GB of memory, which fits on a few cache nodes.
- Servers: if one server handles about 1,000 requests per second, a 30,000 QPS peak needs around 30 servers, plus headroom for failures and deployments.
- Present results as round numbers and state what each implies for the design.
More in Back-of-the-Envelope Estimation
| # | Problem | Platform | Difficulty | Open | 1st1st Visit | 2nd2nd Visit | RevRevise |
|---|---|---|---|---|---|---|---|
| 1 | Which numbers should you know for back-of-the-envelope estimation? | Concept | Easy | Read the answer to Which numbers should you know for back-of-the-envelope estimation? | |||
| 2 | How do you estimate the queries per second (QPS) a system must handle? | Concept | Medium | Read the answer to How do you estimate the queries per second (QPS) a system must handle? | |||
| 3 | How do you estimate the storage a system will need over several years? | Concept | Medium | Read the answer to How do you estimate the storage a system will need over several years? | |||
| 4 | How do you estimate bandwidth, cache size and the number of servers? | Concept | Medium | Read the answer to How do you estimate bandwidth, cache size and the number of servers? |