πŸ’¬
βœ‰οΈ
πŸ“Έ
▢️

Loading…

Capacity planning: turn users into requests, storage, and bandwidth

Capacity Planning

Capacity Planning

4 of 5

Bandwidth & Latency Budget

Ingress is cheap. Egress will bankrupt you. Here's the math.

Cloud providers charge almost nothing for data coming *in*. They charge a lot for data going *out* (egress). A system with 100:1 read/write ratio β€” like any social feed β€” sends 100Γ— more data than it receives. This is the number that forces CDNs into the architecture.

Formula

Egress = RPS Γ— avg response size Γ— read:write ratio

RPSPeak requests per second (from your RPS calculation)
response sizeBytes sent per response β€” JSON, HTML, images, video
read:write ratioTypical social: 100:1 Β· Email: 10:1 Β· IoT: 1:1

Latency budget = total allowed response time split across every component in the path.

Worked exampleSocial feed at 4,000 RPS (avg)
1
Ingress4,000 RPS Γ— 2 KB req
=8 MB/s

Negligible. Almost always free.

2
Raw egress4,000 Γ— 100 Γ— 50 KB
=20 GB/s

20 GB/s = 160 Gbps. You can't buy enough NICs for this.

3
CDN offload 90%20 GB/s Γ— 0.10
=2 GB/s

CDN handles 90% of reads from edge β€” origin only sees 2 GB/s

4
Latency budget200ms total: network(30)+DB(40)+API(50)+cache(5)+DNS(10)
== 135ms used

65ms headroom for error, retries, slow paths

Takeaway: Without the CDN math, your architecture won't make sense. WITH it, you see exactly why a CDN isn't optional at scale β€” it's load-bearing infrastructure.