Stop 04 · Compute ServicesTopics · 10/10

Compute Cost Optimization

Part of the Cloud Computing Roadmap

In short

Compute is usually the biggest line on a cloud bill, and much of it is waste: idle servers, oversized machines, test boxes left running over Diwali. Cutting it is a skill companies love.

Right-sizing instances, using auto scaling to avoid over-provisioning, and choosing the right pricing model — compute is usually the largest line item in a cloud bill, making it the highest-leverage place to optimize.

The blob character switches off fans and lights in an empty classroom.

Think of it like this

Lights off in the empty classroom

The last student to leave switches off the fans and lights. The classroom still exists tomorrow, but nobody pays to cool an empty room. Most cloud savings are that simple habit, done with tools and scripts.

Watch it happen

The cost-cutting loop

Tag
Measure
Right-size
Schedule
Commit

1/5Tag every resource with owner, project and env. Untagged spend is spend nobody feels responsible for.

The big ideas

What you need to know

Delete the forgotten

Old test VMs, unattached disks, idle load balancers and unused elastic IPs all bill quietly every hour.

Right-size

Match instance size to real usage. Smaller and newer generations often give the same speed for less.

Schedule non-production

Stop dev and staging outside working hours with a script, Lambda on a timer or Instance Scheduler.

Budgets and alerts

Set a monthly budget with alerts at 50%, 80% and 100%. Surprises are cheaper when caught early.

See it in code

Walk through the code

bash
1# This month's cost so far, grouped by service2aws ce get-cost-and-usage \3  --time-period Start=2026-10-01,End=2026-10-27 \4  --granularity MONTHLY \5  --metrics UnblendedCost \6  --group-by Type=DIMENSION,Key=SERVICE7 8# Find disks that aren't attached to anything9aws ec2 describe-volumes --filters Name=status,Values=available \10  --query "Volumes[].[VolumeId,Size,CreateTime]" --output table

1/2Ask Cost Explorer for this month's spend, broken down by service.

Cost Explorer from the CLI shows where the money goes. 'available' volumes are disks no VM is using, but you still pay for them.

Save yourself the pain

Common mistakes

Oops

Doing one big clean-up and never looking again.

Do this instead

Make it a monthly habit. New waste appears every sprint as people spin up test resources.

Oops

Cutting costs by removing redundancy from production.

Do this instead

Save on idle and oversized resources first. Dropping to one zone to save money often costs more in the first outage.

Your mission

Hunt waste in your own account

~30 min

Quick check

A dev server runs 24/7 but is used only 10 a.m. to 7 p.m. on weekdays. What's the simplest big saving?

Go deeper

  1. 1Audit a hypothetical compute setup for over-provisioned or idle resources.
  2. 2Learn to use your cloud provider's cost recommendation tools (e.g. AWS Compute Optimizer).
  3. 3Practice calculating the savings from switching a stable workload to reserved pricing.

More topics at this stop

Stuck on this topic? Ask an Insider

Get 1:1 guidance from people who've walked this exact path — on the InsideEdge app.

Download
InsideEdge