Agent skill
capacity-planning
Forecasting resource usage, load testing interpretation, and scaling limits.
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/other/other/ops-andreibesleaga-gabbe-15
SKILL.md
capacity-planning Skill
This skill guides the estimation of infrastructure needs based on usage patterns.
1. The Universal Formula
Required Replicas = (Target RPS * Avg Request Latency) / Max Thread Utilization
Example:
- Target: 1000 RPS
- Latency: 0.2s (200ms)
- 1 Core handles: 1 / 0.2 = 5 req/s (Sync) OR much higher if Async.
- Rule of Thumb: Run load tests to find "Breaking Point" RPS per instance.
2. Resource Dimensions
| Resource | Bottleneck Symptom | Mitigation |
|---|---|---|
| CPU | High latency, timeouts. | Horizontal Scale (add replicas). |
| Memory | OOM Kills, Crash loops. | Vertical Scale (larger pods), fix leaks. |
| Disk IO | High IOWAIT, slow DB. | Provision IOPS (GP3/IO1), cache reads. |
| Network | Bandwidth limits, packet loss. | Compress data, reduce payload size. |
| DB Connect | "Too many connections". | Connection Pooling (PgBouncer). |
3. Creating a Capacity Plan (Template)
Use templates/ops/CAPACITY_PLAN_TEMPLATE.md.
- Baseline: Current usage (Peak CPU %, Avg RAM).
- Growth Factor: "Marketing launching new campaign, expect 3x traffic".
- Headroom: Always provision +30% buffer for spikes.
- Limits: What hits the ceiling first? (Usually the DB).
4. Load Testing
- Tools: k6, Artillery, Locust.
- Pattern:
- Smoke: 1 VUser (Verify logic).
- Load: Target RPS (Verify stability).
- Stress: Ramp until crash (Find the limit).
- Soak: Run 96% load for 4 hours (Find memory leaks).
5. Auto-Scaling Rules (HPA)
- Don't scale on CPU alone. If app is IO bound, CPU might be low while app is dead.
- Scale Up Fast: Reaction time < 1 min.
- Scale Down Slow: Stabilization window > 5 mins (prevent flapping).
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?