Skip to content
Back to Architecture Decisions

Cost Optimization

The ongoing practice of finding and killing waste without degrading performance.

Why

Cloud spend creeps 5-15% per quarter even without feature growth — idle resources, over-provisioned instances, forgotten dev environments. Cost optimization is the monthly discipline of finding this waste and removing it, which is the highest-ROI engineering work there is: killing $2k/mo of waste takes an afternoon and pays $24k/year forever. Teams that don't do it end up at 3x their necessary bill, at which point finance mandates a painful freeze that delays features. Regular optimization prevents the crisis.

When

Monthly, 2-4 hours per review. Skip only if monthly cloud spend < $500 (the waste is below the effort to find it).

How

1. Pull the cost explorer, group by service, sort descending
2. For the top 5 services, look for:
   - Idle resources (EC2 < 5% CPU for 30 days, unattached EBS)
   - Over-provisioned (RDS with 2x the CPU it uses)
   - Forgotten environments (dev/staging running 24/7)
3. Kill or downsize; tag each saving in a cost-reduction log
4. Right-size via 2 weeks of metrics, not guesses (use recommendations API)
5. Set up anomaly alerts (spend > 20% of forecast) to catch future creep early
6. Review reserved-capacity utilization; re-balance if < 85%

Example

Monthly review findings:
  - 3 dev EC2 running 24/7 (only used 9-5) → schedule stop → $540/mo saved
  - RDS db.r5.large at 8% CPU → downsize to .medium → $310/mo saved
  - 200GB unattached EBS from deleted instances → delete → $23/mo saved
  - CloudFront serving 50GB that's also in S3 directly → tighten cache → $40/mo

Total: $913/mo saved in one afternoon = $11k/year recurring.
Logged in cost-reduction.md for the next review to verify savings persisted.

Common Problems

  • ⚠Right-sizing based on a single peak day — you downsize, hit a real peak, and page; use p95 over 2 weeks.

Best Practices

  • ✓Make cost optimization a named monthly task with an owner, not 'when someone has time' — without an owner it never happens.
  • ✓Track the cost-reduction log publicly so the team sees the cumulative savings — gamification sustains the discipline.

Related Resources