All articles

FinOps · · 8 min read

How to reduce AWS costs without affecting production

By Rushit Chandegara, Founder & CTO, InfraCloudEdge

You can reduce AWS costs without affecting production by making changes in order of risk: start with resources nothing depends on, then non-production environments, then storage, then production compute, and buy commitments last. Each step has a way back, and the riskier steps wait until the safe ones have shown what the real baseline is.

Most AWS bills we review carry the same kinds of waste. The risk is rarely in finding it. The risk is in removing it carelessly, for example by shrinking a database on a Friday or deleting a volume somebody needed. This is the order we follow.

Step 0: look before you change anything

The review needs read-only access and nothing else. Collect four things before proposing a single change:

  • Cost by service and by usage type for the last three months, from Cost Explorer, using amortized cost so upfront payments do not distort a month.
  • Every active Savings Plan and Reserved Instance, with its hourly commitment and end date.
  • Utilisation: CPU, memory, connections and IOPS for the largest instances and databases. Memory needs the CloudWatch agent on EC2, so check whether it is installed before trusting a recommendation.
  • A list of what is tagged, and what is not. Untagged resources are where forgotten environments hide.

AWS Compute Optimizer and Trusted Advisor give a first pass at right-sizing and idle resources. Treat their output as leads to verify, not as a change list.

Step 1: remove what nothing depends on

These changes cannot affect a running workload, because the resources are not attached to one:

  • EBS volumes in the "available" state. Snapshot first if there is any doubt, then delete.
  • Elastic IP addresses that are not associated with anything. AWS now charges for every public IPv4 address, attached or not.
  • Load balancers with no healthy targets, and NAT gateways in VPCs with no running workloads.
  • Snapshots and AMIs from instances that were retired long ago.
  • CloudWatch log groups set to "Never expire". Set a retention period that matches how far back you actually look.

Rollback: a snapshot taken before deletion. Keep it for a month, then remove it too.

Step 2: non-production environments

Dev, QA and UAT environments usually run 24 hours a day and are used for about eight. Production is untouched by anything you do here.

  • Schedule EC2 and RDS instances to stop outside working hours. A stopped RDS instance restarts automatically after seven days, so use a schedule, not a one-off stop.
  • For containers, let test services scale to zero when their queue or traffic is empty.
  • Size test databases for test data. They rarely need the production instance class or Multi-AZ.
# Find unattached EBS volumes in one region (read-only)
aws ec2 describe-volumes \
  --filters Name=status,Values=available \
  --query "Volumes[].{ID:VolumeId,GiB:Size,Type:VolumeType,Created:CreateTime}" \
  --output table

Step 3: storage

Storage changes are low risk because they can be made online, but check each one against how the data is read.

  • Move gp2 volumes to gp3. It is an online change, gp3 costs less per GB, and IOPS and throughput are set separately. Check the current burst behaviour first so a busy volume gets enough provisioned IOPS.
  • Add S3 lifecycle rules: expire incomplete multipart uploads, move old objects to cheaper storage classes, and expire old object versions in versioned buckets.
  • Review backup retention. Thirty-five days of automated RDS backups for a test database is rarely intended.

Step 4: production compute, one change at a time

This is the step that can hurt, so it comes after the others and follows stricter rules.

  • Size against at least two weeks of data that includes your busiest period, and look at peaks, not averages.
  • Change one thing per release window, and watch latency and error rates before the next.
  • For instances behind a load balancer, add the smaller instances alongside the old ones, shift traffic, then remove the old ones. The way back is to shift traffic again.
  • For RDS, a change of instance class means a short interruption. Do it in a maintenance window, on Multi-AZ where possible so the change is applied through a failover.
  • Graviton instance types usually cost less for the same work, but the application must run on ARM. Test in a lower environment first.

Step 5: commitments last

Savings Plans and Reserved Instances are billed every hour whether you use them or not. If you buy them before right-sizing, you lock in the oversized bill. If you already hold commitments, right-sizing below the committed amount saves nothing until they end, so schedule those changes around the expiry dates.

Once usage is stable, cover the steady baseline with a commitment and leave the variable part on demand. Compute Savings Plans are the most forgiving, because they follow you across instance families, regions, Fargate and Lambda.

What this looked like on a real bill

On a recent read-only review for a SaaS platform, production nodes were averaging around 5% CPU. The findings split in two. About 22% of the bill could be removed straight away without touching production data paths. A larger cut, bringing the total to roughly 57%, had to wait for existing reserved commitments to end, so it was written into a dated plan instead of being forced through early.

The second number is an estimate from the approved plan, not a realised saving. That distinction matters when you report savings to finance: say what has landed on the bill and what is scheduled.

Keep it from coming back

  • Set AWS Budgets alerts per account or per environment, and turn on Cost Anomaly Detection.
  • Require an owner and an environment tag on new resources.
  • Review the bill monthly against the list of changes, using amortized cost for the same period.

A short checklist

  • Read-only review: cost by service, commitments with end dates, utilisation, tags.
  • Delete unattached and unused resources, with snapshots as the way back.
  • Schedule or scale down non-production.
  • Fix storage classes, volume types and retention.
  • Right-size production one change at a time, against peak usage.
  • Buy commitments against the new baseline.
  • Add budgets, anomaly alerts and tagging rules.

More articles