<< back to Guides
๐ System Design: Capacity Estimation (Deep Dive)
Capacity estimation helps you predict the resources your system will need to handle expected load, prevent downtime, and plan for scaling.
๐ฏ Why Capacity Estimation Matters
- Avoids underprovisioning (crashes) and overprovisioning (wasted cost)
- Helps choose storage engines, compute resources, and databases wisely
- Provides confidence in meeting SLAs and SLOs
- Sets a solid baseline for autoscaling or load balancing
๐ง Inputs to Estimate
-
Traffic Load
- Requests per second (RPS) or queries per second (QPS)
- Daily Active Users (DAU) / Monthly Active Users (MAU)
- Peak load vs average load
-
Data Size
- Average payload size per request/response
- Daily data growth rate (e.g., logs, user uploads, analytics)
-
Retention Requirements
- How long data needs to be stored (e.g., 30 days, 6 months, forever)
-
Processing Overhead
- CPU usage per request
- Memory footprint per user/session
-
Network Throughput
- Bandwidth required for serving requests
- Ingress/Egress load between services
๐ Example Questions to Ask
- What is the expected RPS at launch?
- Whatโs the peak traffic multiplier? (e.g., 5x daily average)
- How big is each write or read operation in bytes?
- How long do we store user logs, uploads, or sessions?
- How many database read/write ops per second are expected?
๐ Estimation Formula Examples
๐ฆ Storage Estimation
Daily Storage = Requests per Day ร Payload Size
Total Storage (N days) = Daily Storage ร Retention Period
Example:
1,000,000 requests/day ร 2 KB = ~2 GB/day
Retention = 90 days โ 180 GB total
๐งฎ Compute Estimation
Requests per second = Total Requests per Day / 86,400
If each request takes 20ms of CPU:
CPU Load = RPS ร 20ms
= 1000 RPS ร 20ms = 20 CPU cores
Add headroom (~30%) โ 26 cores
๐ Database IOPS Estimation
- Read Ops = RPS ร Read ops/request
- Write Ops = RPS ร Write ops/request
Add 50% overhead for replication/indexing
โ๏ธ Tools & Techniques
- Spreadsheets โ Manual calculations for traffic, storage, CPU
- Load Testing Tools โ Apache JMeter, k6, Locust
- Monitoring Baselines โ Use real metrics if available (Grafana, Datadog)
- Capacity Planning Sheets โ Structured templates to track estimates
๐งฑ Capacity Estimation Framework
1. Estimate baseline RPS / QPS
2. Factor in peak load (e.g., 2x or 10x burst traffic)
3. Estimate per-request data and processing size
4. Project data growth (daily, monthly, yearly)
5. Estimate backend capacity (DB IOPS, bandwidth)
6. Add buffer (25โ50%) for safety and growth
๐ก Pro Tips
- Always plan for peak, not average.
- Use real usage data from similar apps when possible.
- Leave room for future features and traffic spikes.
- Validate assumptions with engineers and business teams.
- Revisit estimations as product evolves or usage patterns shift.