Interactive systems lab / 04
Capacity Planner Lab.
Turn a product shape into a resource plan. Change a single assumption and watch its effect carry through the system.
Start with people. Follow the load.
First move: Lower cache hit rate on the current product. Watch database operations change while peak traffic stays the same.
Set the assumptions
Distinct users active on an average day.
Traffic at the busy hour relative to the daily mean.
Advanced assumptions
Demand
120K people × 28 requests = 3.4M requests/day.
Application fleet
At 400/s per instance and 70% target use, plan 1 busy + 1 spare.
128 reads/s and 28 writes/s reach the app. Cache absorbs 92 reads/s; the database receives the misses plus writes.
Database shape*
1 write partition and 0 read replicas per partition under this simplified budget.
Connection budget
2 instances × 8 connections + 35 reserved = 51 / 250.
Footprint over time
This workload fits the simplified single-database budget. Measure real query plans and load before adding distributed components.
All sizes use decimal KB/GB. Throughput constants are editable assumptions, not universal hardware ratings. The planner ignores variance within a minute, background jobs beyond the connection reserve, failover topology, bandwidth pricing, and service-specific latency.
Under the model
Estimates make assumptions testable.
DAU alone does not set capacity. Requests per user and peak concentration produce traffic. Instance throughput and headroom set a fleet estimate. Read share and cache hit rate change database demand. The configured pool size and maximum instances create a connection ceiling even when the average request is cheap.
Use the result to find questions for a load test. Hardware throughput, query mix, provider limits, replica lag, and failure behaviour must be measured in a real system before a deployment plan is accepted.
- Set cache hit rate to zero and inspect database reads.
- Raise peak multiplier; watch both instances and connection budget.
- Change write size and retention to see storage compound.
Lesson 04 / Check your understanding
Can you explain the result?
Ten app instances each allow 20 DB connections. Workers reserve 30. Can a 150-connection database cover the configured ceiling?