Staging environment costs more than production. Wait, what?

The discovery:

  • Production: auto-scales based on traffic
  • Staging: fixed size "for consistency"
  • Nobody uses staging nights/weekends
  • Same instance sizes as prod "for parity"
  • No auto-shutdown

The math:

  • Production: scales down at night, saves 40%
  • Staging: runs 24/7 at full capacity
  • Usage: 8 hours/day, 5 days/week = 24% utilization
  • Paying for 76% idle time

Solutions we implemented:

  • Scheduled scaling: Scale to 0 from 8PM to 8AM
  • Weekend shutdown completely
  • Smaller instance types (don't need 16 CPU for 3 users)
  • On-demand spin-up via Slack command

Result: 60% cost reduction. Zero impact on development.

Lesson: The most expensive resources are the ones nobody turns off.


← Назад към Научени Уроци