Interview Prep/SRE & Reliability/Capacity & Load Testing

The database is at 85% CPU at peak and growing 5% per month. Plan.

IntermediateScenarioCapacity & Load Testing
Answer

Situation read → Roughly two to three months until saturation. Databases scale slowly, so act now.

What I'd do →

  1. Find top queries by total time (pg_stat_statements, Performance Insights) and optimize the worst ones.
  2. Add caching for read-heavy, rarely changing data.
  3. Move reads to replicas where staleness is acceptable.
  4. Plan a vertical scale during a maintenance window and test it.
  5. Longer term: partitioning or sharding, or splitting workloads.
  6. Add a capacity ticket alert at 70% sustained.

Why → Optimization buys time cheaply; scaling and architecture changes need lead time.

Interview tip → Start with query optimization before throwing hardware at it.

All SRE & Reliability questions Roadmap: SRE & incident response

More on Capacity & Load Testing