September 21, 2024
CloudDevops

AWS Cost Optimisation: An In-Depth Guide

In the vast universe of cloud services, Amazon Web Services (AWS) reigns supreme. With its diverse array of scalable and flexible resources, it has become a pivotal component of many businesses’ digital strategies. However, the very flexibility that makes AWS so enticing often contributes to a common pain point – escalating costs. This blog post is designed to provide effective strategies for AWS cost optimisation, helping you harness AWS resources efficiently and minimise overheads.

Unused Resource Cleanup: EIP, LB, EBS, EC2, and More

Unnecessary AWS expenditures often stem from unused resources. Whether it’s an Elastic IP (EIP) not associated with a running instance, a Load Balancer (LB) without any linked instances, detached Elastic Block Store (EBS) volumes, or idle EC2 instances – these can all add to your AWS bill without adding any value.

By routinely auditing your AWS resources and cleaning up those that are unused, you can significantly reduce your AWS costs. Tools such as AWS Trusted Advisor or third-party solutions like CloudChecker can automate this process, identifying unused or unassociated resources and allowing you to delete or reallocate them as necessary.

SSD Storage Optimisation: GP2 vs. GP3

EBS volumes’ optimisation is another effective cost-saving method. Consider transitioning from GP2 to GP3 SSD volumes. GP3 offers the same baseline performance as GP2 but comes with a 20% lower cost per GB. Plus, GP3 gives you the freedom to increase IOPS and throughput independently, offering more control over performance and cost.

Processor Selection: Graviton or AMD

The choice of processor can also significantly impact your costs. AWS Graviton processors provide a substantial cost advantage compared to traditional Intel Xeon CPUs. These ARM-based chips offer up to 40% better price-performance for a broad range of workloads. Similarly, AMD instances offer a 10% cost advantage over comparable Intel-based instances. Pivoting to either of these from Intel-based instances can be a fruitful way to optimise costs.

Reserved Instances (RI): EC2, RDS, ElastiCache, Redshift, and More

Reserved Instances (RIs) allow you to reserve capacity for specific AWS services and in return, receive substantial discounts compared to on-demand pricing. If you have predictable workloads and can commit to a one- or three-year term, RIs can yield significant savings. Here’s how they apply to various AWS services:

  • Amazon EC2 Reserved Instances: By reserving Amazon EC2 computing capacity for 1 or 3 years, you can achieve significant discounts (up to 75%) compared to on-demand instance pricing.
  • Amazon RDS Reserved Instances: Reserved instances of Amazon Relational Database Service (RDS) can save you up to 60% over on-demand costs by committing to one or three years of usage.
  • ElastiCache Reserved Nodes: With ElastiCache Reserved Nodes, you can reserve a node within a specific cache engine and node type for a one- or three-year term and receive a significant discount compared to on-demand pricing.
  • Amazon Redshift Reserved Nodes: By committing to use Redshift for one or three years, you can save up to 75% compared to on-demand rates.

Compute Savings Plans

Another way to realise significant savings is through AWS Compute Savings Plans. These plans provide a flexible, commitment-based discount model. The plans apply to a wide range of AWS compute services, including EC2, Fargate, and Lambda, providing savings of up to 66%. Importantly, they allow you the flexibility to change instance types, sizes, and regions at any time.

Ephemeral Development Environments

Creating ephemeral development environments that are spun up only when needed and torn down after use can significantly reduce costs. Automation of this process using AWS tools or third-party tools like Terraform or Jenkins can make this process seamless and efficient.

Use Spot Instances for Non-Prod Workloads

For all non-production workloads, consider using AWS Spot Instances. These instances use spare AWS capacity and can offer savings of up to 90% compared to on-demand pricing. While Spot Instances come with the risk of being interrupted, this risk is generally acceptable for non-production environments.

Right-Sizing Over-Provisioned Instances

Over-provisioning is a common issue where the allocated AWS resources far exceed the actual requirement, leading to unnecessary costs. By analyzing your usage patterns with AWS Cost Explorer or AWS Compute Optimiser, you can identify over-provisioned resources. Once identified, you can downsize these instances to better match your needs, resulting in substantial cost savings.

Utilise AWS Budgets and Cost Explorer

AWS Budgets and AWS Cost Explorer are powerful tools provided by AWS to monitor your expenditure. AWS Budgets allows you to set custom cost and usage budgets and alert thresholds, ensuring that you are immediately notified when your costs or usage exceed the set limits.

On the other hand, AWS Cost Explorer provides a user-friendly interface to visualise, understand, and manage your AWS costs and usage over time. Using these tools, you can get granular insights into your expenditure and make data-driven decisions to optimise costs.

Implement Auto Scaling

Auto Scaling allows your applications to scale capacity automatically based on conditions you define. This ensures that you have the right amount of resources running to handle your application load. It can help you optimise costs by adding resources when demand is high and removing unnecessary resources when demand is low, ensuring you only pay for what you need.

Use Amazon CloudFront and AWS Data Transfer

Using Amazon CloudFront (a content delivery network service) can significantly reduce the costs associated with data transfer. CloudFront is integrated with AWS – both physical locations directly connected to the AWS global infrastructure and other AWS services.

AWS also waives data transfer charges when data is transferred from EC2, S3, Amazon RDS, Amazon SimpleDB, Amazon DynamoDB, Amazon Redshift, and Amazon Glacier to CloudFront.

Design for Cost

Many AWS services follow a pay-per-use model, which means the design of your applications can significantly impact your costs. Designing efficient, cost-effective applications and architectures from the ground up is one of the best ways to reduce AWS costs. AWS Well-Architected Framework provides best practices and strategies to help you design and run efficient applications in the cloud.

Optimize Data Storage

Optimising data storage can lead to significant cost savings. Consider leveraging S3 Intelligent-Tiering if you have data with unknown or changing access patterns. For long-term data archiving, AWS Glacier is a cost-effective solution. Also, consider deleting old, unused data or snapshots which are frequently overlooked.

Use AWS Trusted Advisor

AWS Trusted Advisor is an online resource to help you reduce cost, increase performance, and improve security by optimising your AWS environment. Trusted Advisor provides real-time guidance to help you provision your resources following AWS best practices.

Containerisation

If you’re developing new microservices or decomposing monolithic applications, consider using containers. AWS offers services like Elastic Container Service (ECS) and Elastic Kubernetes Service (EKS) for running containerised applications. Containers can share OS and other resources, allowing you to get more value out of your compute resources.

Use AWS Lambda for Event-driven Applications

If you’re developing event-driven applications, AWS Lambda allows you to run your code without provisioning or managing servers. You pay only for the compute time you consume, meaning there’s no charge when your code isn’t running.

Choose the Right Pricing Model for Your Databases

AWS offers several pricing models for its databases like on-demand, reserved instances, and serverless. For predictable workloads, reserved instances can save you money. For unpredictable workloads or new applications, you can use serverless databases that automatically scale capacity up and down based on the workload.

Leverage AWS Spot Instances for Batch Jobs

For applications that have flexible start and end times, or that are only feasible at very low compute prices, AWS Spot Instances can offer significant savings, up to 90% off the on-demand price.

Use AWS Organizations for Consolidated Billing

AWS Organisations allows you to consolidate multiple AWS accounts into an organisation to be managed centrally. It includes consolidated billing across all accounts, which can result in volume discounts due to aggregated usage.

Enable AWS Cost and Usage Report

The AWS Cost and Usage Report contains the most comprehensive set of cost and usage data available. This report includes additional metadata about AWS services, pricing, Reserved Instances, and Savings Plans. Enabling it will give you detailed insights about your spending and usage.

Use Amazon Athena for Querying Large Datasets

Amazon Athena is a serverless, interactive query service that makes it easy to analyse large volumes of data in Amazon S3 using standard SQL. It can be cost-effective because you only pay for the queries that you run.

Utilise AWS Instance Scheduler for Start/Stop Schedules

For instances that don’t need to be running 24/7, consider using AWS Instance Scheduler. It allows you to configure custom start and stop schedules for your EC2 and RDS instances, leading to significant cost savings.

Lifecycle Policies and Versioning in S3

For S3 buckets, make sure you have lifecycle policies in place to move older data to cheaper storage classes or archive them. If versioning is enabled on an S3 bucket, all versions of an object are charged. Therefore, regularly clean up unnecessary versions to save costs.

Take Advantage of Volume Discounts

Certain AWS services offer volume-based discounts. The more you use, the less you pay. For instance, Amazon EC2, Amazon S3, and AWS Data Transfer have tiered pricing.


In addition to these, being vigilant about the evolving pricing models and new services introduced by AWS can help you optimise costs. Joining AWS’ webinars and online training sessions, staying updated with AWS’ announcements, and using cost management tools can provide you with insights and strategies to manage and reduce your AWS costs.

By integrating these strategies with the ones mentioned earlier, you can create a comprehensive AWS cost optimisation strategy. Remember, cost optimisation is a continuous journey and requires regular monitoring and adjustments based on your usage and business requirements.

Leave a Reply

Your email address will not be published. Required fields are marked *