Cost optimisation levers
The main levers for cutting spend without hurting reliability: right-sizing, autoscaling, commitments, spot capacity and storage tiers.
15 min readRight-size before you commit
The first lever is removing waste. Typical fleets run at 15 to 30% average CPU because instances were sized for a launch that never came or copied from another service. Right-sizing uses measured peak utilisation to pick smaller instance types or fewer replicas, and shutting down idle environments, such as staging overnight and at weekends, can cut their cost by about 65%. Do this first: committing to reserved capacity before right-sizing locks in the waste for one to three years.
Autoscaling and capacity mix
Traffic with a daily cycle, such as a peak four times the overnight trough, wastes most of a fixed fleet's capacity. Horizontal autoscaling on a leading signal (requests per instance or queue depth, rather than CPU alone) tracks demand. CPU lags behind load and misleads for I/O-bound services, while queue depth tells you directly how much work is waiting. Scale out quickly and scale in slowly, with a cooldown of several minutes, so the fleet does not oscillate. Then cover the load with the cheapest suitable capacity.
- Reserved or committed-use capacity for the steady baseline: typically 30 to 60% cheaper
- On-demand for the daily peak above the baseline
- Spot or preemptible capacity for interruptible work such as batch jobs and CI builds: often 60 to 90% cheaper, but instances can vanish with two minutes' notice
Storage tiers and data lifecycle
Storage grows forever unless something deletes it. Lifecycle rules move objects to cheaper tiers as they age: standard object storage for recent data, infrequent-access tiers after 30 days, and archive tiers, which can be over ten times cheaper per GB, after 90 to 180 days, with retrieval in minutes to hours. Compress and use columnar formats such as Parquet for analytical data, delete orphaned snapshots and old build artefacts, and set retention on every bucket and log index when it is created.
Architectural levers
The largest savings come from design changes. A cache with a 90% hit rate removes most database reads. A CDN cuts egress and origin load. Keeping chatty services in the same zone avoids cross-zone transfer charges. Moving slow work to queues lets workers run at high, steady utilisation on cheap capacity. Always check the reliability impact: removing a replica to save money is only a saving until the incident it would have prevented. Track savings in the same unit-cost terms as the cost model, so the result is visible and comparable.
Key takeaways
- Right-size and remove idle resources before buying commitments
- Cover baseline with reservations, peaks with on-demand and batch with spot
- Lifecycle rules and archive tiers keep storage costs from growing forever
- Caches, CDNs and zone-aware placement are architectural cost levers
Sign in to track lessons and earn badges.