Dev tools
Cloud Cost Optimization: Practical Ways to Cut Spend
Cloud cost optimization step by step: find waste, rightsize, schedule, commit, tier storage and cut data transfer, with a worked example and FinOps basics.
Cloud cost optimization is the ongoing work of paying less for the cloud resources you need, without hurting performance or reliability. It means removing waste, matching resources to real demand, buying capacity in cheaper ways and designing systems so they cost less to run. Done well, it routinely cuts a bill by a quarter to a third without anyone noticing a difference, except finance.
Cloud bills grow quietly because creating resources is easy and nobody is forced to delete them. A test server left running, an oversized database, snapshots kept forever, traffic flowing through an expensive network path: each is small, but together they add up. This guide explains the practical ways to reduce cloud costs in the order that usually pays off best, with a worked example and AWS figures. It also covers how the FinOps practice keeps savings from creeping back.
Cloud Cost Optimization at a Glance
| Lever | What you do | Typical effort | Risk |
|---|---|---|---|
| Visibility | Tag resources, assign owners, set budgets and alerts | Low | None |
| Remove idle resources | Delete unused servers, volumes, snapshots, IPs, load balancers | Low | Low, if you check owners |
| Schedule non-production | Turn dev and test off outside working hours | Low | Low |
| Rightsize | Move to smaller or newer instance types that fit actual use | Medium | Medium; test first |
| Commitment discounts | Savings Plans or Reserved Instances for steady baseline use | Low | Lock-in if usage drops |
| Spot capacity | Run interruptible work on spare capacity | Medium | Interruptions |
| Storage tiering | Move cold data to cheaper classes; lifecycle rules | Low to medium | Retrieval fees and delays |
| Data transfer | Cut cross-zone, cross-region and internet egress; use a CDN | Medium | Architecture changes |
| Architecture | Autoscaling, serverless, managed services, caching | High | Engineering time |
What Is Cloud Cost Optimization?
So, what is cloud cost optimization in practice? It rests on one idea: in the cloud, you pay for what you provision, not what you use. A server sized for peak traffic costs the same at 3 a.m. as at noon. A volume holding nothing still bills by the gigabyte. Optimisation closes the gap between what you're paying for and what you need.
There are four kinds of saving:
- Use less: delete what nobody needs, and turn off what isn't needed right now.
- Use the right size: match instance and database sizes to real demand.
- Pay less per unit: commitment discounts, Spot capacity, cheaper storage tiers, newer and more efficient instance types.
- Design for cost: architectures that scale with demand and avoid expensive patterns such as heavy cross-region traffic.
For a software company, cloud cost is often the largest part of cost of goods sold, so it directly shapes SaaS gross margin.
Step 1: Get Visibility First
You can't optimise what you can't see. Before changing anything:
- Turn on detailed billing. On AWS, use Cost Explorer and the Cost and Usage Report; other providers have equivalents.
- Tag everything. At minimum, team or owner, environment (prod, staging, dev) and service or product. Enforce tags with policies so new resources can't be created without them.
- Break the bill down. Which services, accounts and teams cost the most? Usually a handful of items make up most of the bill.
- Set budgets and anomaly alerts. A sudden doubling should page someone the same day, not show up on next month's invoice.
- Share the numbers. Teams that see their own costs make better decisions without being told.
Step 2: Remove Idle and Orphaned Resources
This is the quickest win. Common culprits:
- Unattached block volumes left behind when servers were deleted.
- Old snapshots and machine images kept with no retention policy.
- Idle servers with near-zero CPU for weeks.
- Unused elastic IPs, load balancers and NAT gateways, which bill even with little or no traffic.
- Forgotten environments from finished projects, demos and experiments.
- Old log data stored indefinitely at full price.
Find the owner before deleting anything. If nobody claims a resource after a set notice period, snapshot it if it holds data, then remove it.
Step 3: Schedule Non-Production Environments
Development, test and staging environments rarely need to run around the clock. A week has 168 hours. An environment that runs 12 hours a day, five days a week, uses 60 of them, cutting its compute cost by about 64%. Running only 10 hours a weekday, 50 hours in total, saves about 70%.
Use your provider's instance scheduler, a simple scheduled function, or autoscaling groups set to zero outside working hours. Make it easy for developers to switch an environment on when they need it at odd times.
Step 4: Rightsize Compute and Databases
Many resources are sized for a guess made at launch and never revisited. Look at at least two weeks of CPU, memory, disk and network metrics, including peaks.
- If peak CPU and memory stay well under half of capacity, try the next size down.
- Move to current-generation instance types, which usually give more performance per unit of cost than older ones.
- Consider Arm-based instances (such as AWS Graviton) for workloads that support them; AWS markets them as offering better price performance than comparable x86 instances.
- Rightsize databases too, including storage and provisioned IOPS, which are often set far above need.
Make changes gradually and watch latency and error rates after each one. AWS Compute Optimizer and similar tools from other providers suggest candidates automatically.
Step 5: Use Commitment Discounts and Spot
Once you've removed waste and rightsized, buy the remaining steady capacity more cheaply. The main AWS options:
| Option | Discount vs on-demand (AWS figures) | Commitment | Flexibility | Best for |
|---|---|---|---|---|
| On-demand | None | None | Full | Spiky or unpredictable use |
| Compute Savings Plans | Up to 66% | 1 or 3 years, a set spend per hour | Any instance family, region, size, OS; also Fargate and Lambda | Steady baseline that may change shape |
| EC2 Instance Savings Plans | Up to 72% | 1 or 3 years | One instance family in one region | Very stable workloads |
| Reserved Instances | Similar to Savings Plans | 1 or 3 years, specific instance attributes | Lower | Databases and other services with reservations |
| Spot Instances | Up to 90% | None | Can be interrupted with short notice | Batch jobs, CI, stateless workers, training that checkpoints |
The rule of thumb: cover your steady baseline with commitments, let on-demand handle peaks and send interruptible work to Spot. Start with a commitment covering the minimum usage you're confident will continue, not the average. You can always add more later, but you can't easily undo an overcommitment.
Step 6: Optimise Storage
Storage grows forever unless someone stops it.
- Use lifecycle rules to move older objects to infrequent-access or archive classes automatically, and to delete what you no longer need.
- Pick the right block volume type. On AWS, gp3 volumes cost 20% less per GiB than gp2 and let you set IOPS and throughput separately, so migrating from gp2 is often a free saving.
- Set snapshot retention, so you keep the backups you need and no more.
- Compress and deduplicate logs and backups before storing them.
- Choose the right storage type for the job. Our guide to object storage vs block storage explains when each is cheaper.
Watch for retrieval fees and minimum storage durations on archive tiers. Moving data that is read often to a cold tier can cost more, not less.
Step 7: Reduce Data Transfer Costs
Data transfer is the line item that most often surprises teams. Typical charges include traffic out to the internet, between regions, between availability zones and through NAT gateways.
- Put a CDN in front of static and cacheable content to cut egress from your servers.
- Keep chatty services in the same zone where reliability allows, and avoid unnecessary cross-region replication.
- Use private endpoints for cloud services such as object storage, so traffic doesn't flow through a NAT gateway.
- Compress responses and avoid sending more data than the client needs.
Step 8: Design for Cost
The biggest long-term savings come from architecture:
- Autoscaling so capacity follows demand instead of sitting at peak.
- Serverless or containers for spiky or low-volume workloads.
- Caching to avoid repeated expensive queries or computations.
- Managed services where they cost less than the engineering time to run your own.
- Queues and batch processing to smooth peaks.
AI workloads deserve special attention, since GPU and API costs can dwarf everything else. Our guide to reducing LLM costs covers caching, model routing and batching for language models.
Kubernetes Cost Optimization
Containers add a layer where waste hides. The cloud bill shows nodes, not which team's pods are using them, and clusters are often far bigger than the workloads inside them.
- Set resource requests from real usage. Pods reserve capacity based on their CPU and memory requests, not on what they use. Inflated requests leave nodes looking full while sitting mostly idle.
- Let the cluster scale. Use a cluster autoscaler (or Karpenter on AWS) so nodes are added and removed with demand, and a horizontal pod autoscaler for the workloads themselves.
- Pack nodes efficiently. Fewer, appropriately sized node types usually waste less than many small ones.
- Run interruptible pods on Spot nodes, such as batch jobs and CI runners, with separate node pools.
- Allocate cost by namespace or label, using tools such as OpenCost, so teams see what their services cost.
Small teams should also ask whether they need Kubernetes at all: a few managed containers or virtual machines can cost far less to run and operate.
Equivalents on Azure and Google Cloud
The same levers exist on every major cloud, under different names:
| Lever | AWS | Azure | Google Cloud |
|---|---|---|---|
| Flexible commitment | Compute Savings Plans | Azure savings plan for compute | Flexible committed use discounts |
| Specific commitment | Reserved Instances, EC2 Instance Savings Plans | Reserved VM Instances | Resource-based committed use discounts |
| Spare capacity | Spot Instances | Spot Virtual Machines | Spot VMs |
| Automatic discounts | None by default | None by default | Sustained use discounts on eligible machine types |
| Recommendations | Compute Optimizer, Trusted Advisor | Azure Advisor | Recommender |
| Cost tools | Cost Explorer, Budgets | Cost Management | Cloud Billing reports, budgets |
Azure also offers Azure Hybrid Benefit, which lets you apply existing Windows Server and SQL Server licences to cloud machines.
Running a Monthly Cost Review
A short, regular review stops costs from creeping back. A 30-minute monthly meeting with an engineering lead, someone from finance and the owners of the biggest services is enough for most startups:
- Total and trend: this month versus last month and the forecast.
- Top movers: the five services or teams whose costs changed most, and why.
- Anomalies: any alerts, and whether the cause is fixed.
- Commitment coverage and utilisation: how much steady usage is covered, and whether any commitments sit unused.
- Unit cost: cost per customer or per transaction, compared with the target.
- Actions: a short list of owners and dates, checked at the next review.
AWS Cost Optimization Best Practices
AWS cost optimization best practices, collected in one checklist:
| Area | Practice |
|---|---|
| Visibility | Cost Explorer, Cost and Usage Report, cost allocation tags, AWS Budgets, Cost Anomaly Detection |
| Waste | Trusted Advisor and Compute Optimizer recommendations; delete unattached EBS volumes and old snapshots |
| Compute | Rightsize; current-generation and Graviton instances; Savings Plans for baseline; Spot for interruptible work |
| Storage | S3 lifecycle rules and Intelligent-Tiering; gp2 to gp3 migration; snapshot retention |
| Network | CloudFront for egress; VPC endpoints instead of NAT for AWS services; keep traffic in one AZ where sensible |
| Governance | Tag policies, account structure per team or environment, regular cost reviews |
| Architecture | Auto Scaling, Lambda and Fargate for spiky loads, caching |
The AWS Well-Architected Framework has a dedicated Cost Optimization pillar that covers these practices in more depth.
Worked Example: Cutting a Monthly Bill
A startup's monthly cloud bill is 20,000 units: compute 11,000 (of which dev and test 2,000), databases 3,000, storage 3,000, data transfer 2,000 and other 1,000. Here's what each step saves, applied in order. The percentages are illustrative but realistic.
| Step | Assumption | Monthly saving |
|---|---|---|
| Remove idle resources | 8% of compute idle; 15% of storage orphaned | 1,330 |
| Schedule dev and test | Run 60 of 168 hours | 1,286 |
| Rightsize compute | 20% reduction on what's left | 1,767 |
| Commitment discount | 70% of remaining compute covered at 30% off | 1,484 |
| Storage tiering | 25% saving on remaining storage | 638 |
| Data transfer | CDN and endpoints cut 30% | 600 |
| Total | 7,104 (35.5%) |
The new bill is about 12,900 units, with no change to the product. Note the order. Committing before rightsizing would have locked in discounts on capacity the team later removed.
FinOps vs Cloud Cost Optimization
On FinOps vs cloud cost optimization: cost optimisation is the set of technical actions, such as deleting, rightsizing and committing. FinOps is the operating practice around them: a cultural and financial discipline that brings engineering, finance and product together to make cost-aware decisions, with shared accountability.
The FinOps Foundation describes a repeating lifecycle of three phases:
| Phase | Goal | Examples |
|---|---|---|
| Inform | Visibility and allocation | Tagging, showback, budgets, forecasts |
| Optimize | Reduce rates and usage | Rightsizing, commitments, Spot, removing waste |
| Operate | Run it as an ongoing process | Policies, automation, regular reviews, unit cost targets |
Without FinOps, optimisation tends to be a one-off clean-up followed by slow regrowth. With it, cost becomes a metric teams watch, like latency or error rate.
A useful FinOps habit is tracking unit costs: cloud cost per customer, per transaction or per thousand requests. Total spend can rightly grow with the business; unit cost should fall or stay flat.
Common Mistakes
- Buying commitments first. Clean up and rightsize, then commit.
- Overcommitting. Cover your confident minimum, not your average.
- Optimising once. Without ownership and reviews, costs grow back.
- Cutting reliability to save money. Removing redundancy from production is a false economy.
- Ignoring engineering time. A saving that takes a month of engineer time to save a small amount isn't worth it.
- Forgetting data transfer. It's often the hidden line item.
FAQ
How much can cloud cost optimization save?
It depends on how much waste exists. Organisations that have never optimised usually find meaningful savings from cleanup, scheduling, rightsizing and commitment discounts alone, before any architectural change. The worked example above lands at about a third.
What is the fastest way to reduce cloud costs?
Delete idle and orphaned resources, then schedule non-production environments to turn off outside working hours. Both are low risk and take days, not months.
Are Savings Plans better than Reserved Instances?
For EC2 compute, Savings Plans are usually more flexible for similar discounts. Reserved Instances still matter for services that use them, such as some managed databases.
Is Spot safe for production?
For stateless, fault-tolerant workloads spread across instance types, yes. For a single stateful server, no: Spot capacity can be reclaimed with short notice.
Who should own cloud costs?
The teams that create the resources, with finance and a FinOps lead providing visibility, targets and tools. Central control alone rarely works.