What is AWS Cost Optimization?
Migration to the cloud has changed the way organizations associate and account for costs. Pay-as-you-go pricing, decentralized procurement, and extensive cloud service offerings are causing organizations to approach IT-related finance processes differently – this movement is known as FinOps, or financial operations.
In the AWS cloud, you can control costs and optimize cloud spend using a variety of strategies and tools. AWS provides multiple resource options and purchasing models, which provide flexibility for building infrastructure in a cost-effective way.
This is part of a series of articles about AWS cost.
In this article:
- Best Practices and Strategies for Optimizing AWS Costs
- Choose the Right AWS Region
- Single Billing For All Accounts
- Choose the Right Pricing Models
- Turn Off Unused Instances by Creating Schedules
- Identify Amazon EC2 Instances With Low-Utilization and Stop or Rightsize Them
- Review Networking and Reduce Costs by Deleting Idle Load Balancers
- Monitoring the Use of Storage
7 Tips and Best Practices for Optimizing AWS Costs
1. Choose the Right AWS Region
Choosing an AWS Region should be your first choice when setting up an AWS deployment. You cannot start using the AWS Management Console, SDK, or CLI before choosing a region. People usually choose an area based on distance from their business location, but there are other factors to consider:
- Cost AWS pricing varies by region—see the AWS cost calculator to calculate the cost for a specific region.
- Latency—choose regions close to your target audience to reduce latency for your application.
- Service availability—not all services are available in all regions, so check which services you need before selecting a region.
2. Get Unified Billing For All Accounts
If you have multiple accounts, getting one invoice can be very useful for tracking your expenses and monitoring your spending. This gives you an overview of all AWS charges incurred in your account.
In a consolidated billing family, the master account pays charges accrued by all other accounts. Easily track costs per account and access cost data as a CSV file.
3. Choose the Right Pricing Models
You can optimize your AWS costs by choosing the most suitable pricing models for each type of workload.
This pricing model can help you reduce costs when using Amazon EC2, Relational Database Service (RDS), Amazon Redshift, Elasticsearch, and ElastiCache. Reserved instances can help you save up to 70% off equivalent on-demand Amazon EC2 and Amazon RDS capacity. You can get this discount only if you commit to one or three years.
There are three types of reserved instances payment options—all up-front (AURI), partial up-front (PURI), and no upfront payments (NURI). You can also use AWS Cost Explorer RI Purchase Recommendations for Redshift, RDS, Elasticsearch, and ElastiCache usage.
You can leverage spot instances to reduce your EC2 costs. Spot instances provide up to 90% off the on-demand prices without a term-based commitment. AWS provides these large discounts for unused capacity and can take it back when needed.
Use spot instances for fault-tolerant, scalable, or flexible workloads, such as:
- Big data workloads like Amazon EMR, Spark, and Hadoop clusters.
- Containerized workloads like Amazon Elastic Container Servic, Amazon Elastic Kubernetes Service (EKS), or self-managed Kubernetes.
- High-performance computing (HPC) like batch jobs, genomic sequencing, and grid servers.
- CI/CD pipelines.
- Test and development environments.
- Web servers.
AWS savings plans
These plans can help you reduce Fargate, Lambda, and EC2 costs. This flexible pricing model provides up to 72% off your AWS compute usage. For example, it can offer lower prices on EC2 instances usage, regardless of instance size, family, operating system, AWS Region, and tenancy.
AWS saving plans also provide discounts on AWS Fargate and AWS Lambda usage. You can use AWS Cost Explorer recommendations to discover discounts and ensure you use the relevant compute capacity. There are no upfront options. You can sign up for savings plans, and then AWS automatically charges your compute usage using discounted savings plan rates.
4. Turn Off Unused Instances by Creating Schedules
To optimize costs, shut down unused instances, especially at the end of the work day and on weekends and holidays. For non-production instances, plan a schedule of on/off times.
Evaluate usage metrics to determine when an instance will be used more broadly, so you can implement a more aggressive plan or an always-on downtime plan that can be interrupted when access to the instance is needed. It’s important to understand that when your instance terminates, you are still paying for EBS storage volumes and everything else connected to it.
5. Find EC2 Instances With Low Utilization and Stop or Rightsize Them
Get a report on idle or underutilized EC2 instances using the AWS Cost Explorer Resource Optimization report. You can reduce costs by stopping or scaling down these instances. You can also automatically stop instances using AWS Instance Scheduler, and automatically resize EC2 instances using AWS Operations Conductor (based on Cost Explorer’s recommendation report).
AWS Compute Optimizer provides recommendations for scaling within or across instance families, scaling to remove performance bottlenecks, and recommendations for EC2 instances that are part of an Auto Scaling group.
6. Review Networking and Reduce Costs by Deleting Idle Load Balancers
Use the Trusted Advisor idle load balancer check to get a report of load balancers with RequestCount less than 100 in the last 7 days. Then delete these load balancers to reduce costs.
If transferring data from EC2 to the public internet is expensive, consider using Amazon CloudFront. You can use the Amazon CloudFront Content Delivery Network (CDN) to cache images, videos, or static web content at AWS edge locations around the world. CloudFront does not need to over-provision capacity to handle potential traffic spikes.
7. Monitoring Storage Use
Monitor your S3 usage. Use the S3 analytics tool to evaluate storage access patterns for a given dataset of objects over a 30-day period. Use the S3 Infrequently Access (S3 IA) storage to save money for data that is not commonly used. Users can use lifecycle policies to automatically transfer objects to lower-cost storage tiers. Another option is to use S3 Intelligent-Tiering to automatically analyze and transfer objects to the relevant storage tier.