Capacity Peak Planner: UI-Driven Exercise
Overview
Capacity Peak Planner is an interactive, web-based UI tool designed as a hands-on capacity planning exercise. Users simulate traffic peaks (e.g., sales events, viral spikes) and interactively map them to mitigation strategies: caching, rate limit cushions, and third-party dependencies.
The tool uses a drag-and-drop timeline for peak modeling, sliders/config panels for strategy tuning, and real-time visualizations (charts, heatmaps) to show load impacts. It calculates metrics like peak load reduction, error rates, cost savings, and SLO compliance (e.g., 99.9% availability).
- Target Users: SREs, architects, devs.
- Tech Stack (for impl): React/Vue for UI, D3.js/Chart.js for viz, local JS engine for sims (no backend needed).
- Exercise Flow: Input peaks → Tune strategies → Simulate → Iterate → Export report.
UI Layout
Single-page dashboard with modular sections (resizable panels via Split.js). Top: Toolbar (save/load, export PDF/CSV). Bottom: Real-time metrics summary.
┌──────────────────────────────────────────────────────────────┐
│ Toolbar: [Load Scenario] [Save] [Export Report] [Reset] │
├──────────────┬──────────────┬──────────────┬─────────────────┤
│ Peak Model │ Caching │ Rate Limits │ 3rd-Party Deps │
│ (Timeline) │ Strategy │ Cushions │ Management │
├──────────────┼──────────────┼──────────────┼─────────────────┤
│ Simulation Viz (Multi-Chart Dashboard) │
│ [Load Graph] [Error Heatmap] [Cost Breakdown] [SLO Gauge] │
└──────────────────────────────────────────────────────────────┘
1. Peak Model (Left Panel: Drag-and-Drop Timeline)
Model traffic over 24h/7d with peaks.
-
Inputs:
| Component | Description | Example |
|---|
| Baseline RPM | Requests Per Minute slider | 1k RPM |
| Peak Events | Drag peaks onto timeline (duration, multiplier) | Black Friday: 10x for 2h |
| User Segments | Stackable cohorts (e.g., mobile vs web) | 60% mobile, 2x peak |
| Export/Import | JSON for scenarios | { "peaks": [{start: "14:00", mult: 10, dur: 120}] } |
-
Viz: Interactive Gantt/timeline chart. Hover: preview load. Drag to adjust.
-
Mapping Trigger: Peaks auto-populate "stress" in strategy panels (e.g., "10x peak = 10k RPM uncached").
2. Caching Strategy (Top-Right Panel)
Tune cache to absorb peaks. Simulates hit/miss ratios.
-
Inputs (Sliders + Presets: Redis/Memcached/CDN):
| Param | Range | Impact Calc |
|---|
| Hit Rate | 0-95% | Reduces DB load by hit% |
| TTL | 1m-24h | Balances freshness vs offload |
| Cache Size | 1GB-1TB | Eviction rate (LRU sim) |
| Invalidation | Manual/Event | Peak refresh cost |
-
Real-Time Viz: Stacked bar (hits/misses) overlaid on peak timeline. Equation: Cached Load = Peak RPM * (1 - Hit Rate).
-
Exercise Insight: Drag peak → See uncached load spike → Tune hit rate → Watch DB load flatten 70%.
3. Rate Limit Cushions (Middle-Right Panel)
Add burst buffers to prevent cascading failures.
-
Inputs (Per-API/Endpoint groups):
| Param | Range | Impact Calc |
|---|
| Base Limit | 100-10k RPM | Per-user/IP |
| Cushion % | 0-200% | Burst allowance (e.g., 150% = 1.5x headroom) |
| Decay Window | 1-60m | Token bucket refill |
| Reject Action | 429/Queue | Backpressure sim |
-
Real-Time Viz: Waterfall chart: Incoming → Cushioned → Throttled. Heatmap: Reject % by peak hour.
-
Exercise Insight: 10x peak overloads base → Add 150% cushion → Rejects drop to 5%, queue stabilizes.
4. Third-Party Dependencies (Bottom-Right Panel)
Model external risks (e.g., Stripe, AWS S3).
-
Inputs (Table + Dependency Graph):
| Dependency | Latency (ms) | Quota (RPM) | Failure % | Retry Budget |
|---|
| Payment API | 50-500 | 5k | 0.1-5% | 3x |
| Image CDN | 100-1k | Unlimited | 1% | N/A |
- Graph: Nodes (your app → deps), edges (traffic % routed).
-
Real-Time Viz: Dependency waterfall (total latency = sum weighted). Failure cascade sim: Peak Errors = Peak RPM * Dep Fail % * (1 - Circuit Breaker).
-
Exercise Insight: Peak hits quota → Add cushion/proxy → Fallback to cache → Errors <1%.
Simulation Viz (Main Dashboard)
Holistic view updates live on input changes.
- Load Graph: Line chart (4 lines: Raw Peak, Post-Cache, Post-RateLimit, Post-Deps). Y: RPM/CPU%. X: Time.
- Error Heatmap: Grid (time vs component), color: error rate.
- Cost Breakdown: Pie (infra + 3rd-party fees). Slider: $/RPM.
- SLO Gauge: Dial (target 99.9%) + Alerts (e.g., "Cache hit <70%: DB overload imminent").
- What-If Slider: Global "Peak Multiplier +X%" for sensitivity.
Key Equation (Core Sim):
Final Load = Peak RPM * (1 - Cache Hit) * Rate Cushion Factor * (1 - Dep Fail %)
Error Rate = (Throttled % + Dep Fails + Timeouts)
Exercise Mode (Guided Tutorial)
- Onboarding Wizard: Step 1: Build baseline peak. Step 2-4: Tune one strategy. Step 5: Optimize all.
- Challenges:
- "Reduce 10x peak DB load <20% orig."
- "Handle 5% dep failure w/o SLO breach."
- "Min cost for 99.99% during 1h burst."
- Scoring: Efficiency score (load reduction / config complexity).
- Shareable: URL params for scenarios.
Export Report
PDF/JSON: Screenshots + data table.
Scenario: Black Friday 10x
- Raw Peak: 10k RPM → Errors: 45%
- Optimized: Cache 80% + 150% Cushion + CB → Load: 1.2k RPM, Errors: 0.5%, Cost: -$20k/mo
Implementation Notes
- Perf: Client-side Monte Carlo sim (10k iterations/sec).
- Extensibility: Plugin slots for custom strats (e.g., autoscaling).
- Accessibility: ARIA labels, keyboard nav, color-blind modes.
This tool turns abstract planning into an intuitive, gamified exercise—users "see" how strategies interplay during peaks! Deployable as GitHub Pages for instant use.