SynfraCore
Synfracore
Start Learning
Navigation

Academies

Platform

RoadmapsLabsCertificationsInterviewPYQsAI AssistantCareer
Start Learning Free🗺️ Learning Roadmaps

Capacity PlanningCheatsheets

Quick reference — commands, syntax, and patterns

✍️
Written by senior engineers. Reviewed for technical accuracy.· Updated 2025 · SynfraCore Capacity Planning Team
Expert Content

Capacity Planning — Quick Reference

k6 load testing — core commands

bash
# Basic load test — fixed number of virtual users
k6 run --vus 500 --duration 10m load-test.js

# Ramping load — gradually increase VUs to find the breaking point (stress test)
k6 run --stage 2m:100,5m:500,5m:1000,2m:0 load-test.js

# Soak test — moderate sustained load over hours, catches slow leaks
k6 run --vus 200 --duration 4h load-test.js

# Output results to a file for later analysis
k6 run --out json=results.json load-test.js

Scaling thresholds — starting reference

SignalTypical triggerAction

|---|---|---|

CPU utilization> 70% sustained for 5 minScale out
Memory utilization> 80% sustainedScale out, or investigate a leak
Queue depthGrowing faster than consumption rateAdd consumers/workers
P99 latencyApproaching SLO thresholdImmediate scale + investigate

Test type reference

TestPurposeDuration

|---|---|---|

Load testConfirm system holds at expected peakMinutes
Stress testFind the actual breaking point, beyond expected peakMinutes to an hour
Soak testCatch memory leaks / slow degradationHours to days

Kubernetes HPA — quick commands

bash
# View current HPA status and target utilization
kubectl get hpa

# Describe an HPA — shows recent scaling events and why they triggered
kubectl describe hpa api-hpa

# Manually override replica count temporarily (bypasses HPA until it reconciles)
kubectl scale deployment api --replicas=20

Headroom sizing — rough formula

Required capacity = Forecast peak × (1 + safety margin)

Typical safety margin: 20-40%
  - Lower end (20%): predictable traffic, fast/reliable autoscaling
  - Higher end (40%+): spiky/unpredictable traffic, slow autoscaling reaction

Multi-region failover headroom (if applicable):
  Region capacity ≥ own steady-state peak + failover share of a failed region's peak

Forecasting inputs checklist

[ ] Historical growth trend (enough history to separate trend from noise)
[ ] Seasonal patterns (identified and decomposed, not folded into trend)
[ ] Known planned events (launches, campaigns) forecast explicitly
[ ] Business-side leading indicators (signups, active users) cross-checked
[ ] Peak — not average — utilization used as the baseline

Pre-event capacity checklist (launch, sale, campaign)

[ ] Forecast expected peak using the best available comparable data
[ ] Dedicated load test run at forecast peak + margin, well before the event
[ ] Pre-scaled ahead of the event, not relying solely on reactive autoscaling
[ ] Rollback / circuit-breaker / graceful-degradation plan defined for
    the case where actual traffic exceeds forecast + margin
Share:
Join our Community
Daily tips, job alerts, interview help — join engineers learning together
Also Worth Exploring
← Back to all Capacity Planning modules
CertificationNotes