AWS Cost Optimization 101: useful tools and step-by-step guide

Vadim K.
Vadim K.
May 3, 2024 •10 min read

Cloud computing has completely transformed the way businesses operate, offering the flexibility to quickly configure resources and control costs. But with the benefits of cloud computing comes the risk of cost overruns if not managed properly.

Main banner

In this article, we will explore ways that can help a company optimize its costs using one of the most popular cloud computing services - AWS.

So buckle up and get ready to take notes!

What can the lack of cost optimization lead to?

Businesses use a pay-as-you-go model for cloud computing to make sure they get the most out of their resources. That being said, if this method isn't carefully watched, it can waste time and money.

Neglecting to optimize cloud services can have detrimental effects on a company's operations and financial health:

Costs Going Up: If you don't take steps to reduce costs, your AWS costs could get out of hand, which would put a lot of stress on your finances.

Underutilized Resources: You waste time and money, and important resources sit idle or aren't used enough.

Overruns on the budget: If companies don't do accurate budgeting and forecasting, they could go over their budgets, which could cause financial problems and even stop activities.

Poor Performance: Not allocating resources properly and choosing the wrong instance types can slow down an application, making users unhappy and lowering productivity.

Stifled Growth: Spending too much on AWS without creating any value in return limits investments in new ideas, research, and employee growth, which hurts long-term growth chances.

Overall, there are more than a dozen tools and services that may help optimize AWS budget. Below, we'll mention the most popular ones.

AWS CloudWatch

Allows customers to observe metrics, monitor log files, trigger alarms, and automatically react to AWS resource changes. It displays resource performance and health, aiding users in optimizing consumption and expenditures.

AWS CloudWatch interface

AWS CloudWatch Dashboard

CloudWatch also enables users to establish threshold or custom metric alarms. These alerts assist customers in optimizing costs by taking proactive measures when resource usage exceeds restrictions. Users can receive messages when their EC2 instances are routinely overutilized, prompting them to right-size or optimize their application code to save resources.

Pros:

  • Combination of regular and structured JSON logs alongside custom metrics.
  • Included in AWS, making it easily accessible for users.
  • Plug & play awslogs agent simplifies data transfer from applications to CloudWatch.
  • Custom dashboards offer personalized visualization of critical data.
  • Ability to combine log data with AWS' built-in metrics for deeper insights.
  • Integration with AWS autoscaling features, facilitating dynamic resource adjustments.
  • Log insights feature provides additional analysis capabilities.

Cons:

  • Dashboard can feel limiting at times.
  • Filtering functionality may be perceived as janky or inefficient.

AWS Savings Plans

These flexible pricing plans save consumers with predictable usage patterns a lot of money. They offer automatic AWS consumption discounts without requiring upfront payments or long-term commitments. Savings Plans cover a wide range of AWS services and locations, allowing users to save money wherever their resources are deployed.

RI Reports

Tools known as RI Reports can assist you in understanding how to use Reserved Instances (RIs) more efficiently. They provide in-depth reports on RI usage, compatibility with all AWS services, and maximizing the benefits of RI purchases.

AWS Trusted Advisor

It offers real-time guidance to help users optimize their AWS infrastructure, improve performance, enhance security, and reduce costs. Trusted Advisor analyzes users' AWS environments against best practices and AWS recommendations across five categories: cost optimization, performance, security, fault tolerance, service limits.

AWS Trusted Advisor interface

AWS Trusted Advisor Priority Menu

However, like any solution, it has its pros and cons. Below, we have prepared the main points about the service that its users talk about.

Pros:

Security Audits and Compliance: AWS Trusted Advisor proves invaluable for conducting security audits and ensuring compliance with best practices. Users appreciate its ability to identify security vulnerabilities, such as overly permissive security group configurations, aiding in the mitigation of potential risks.

Cost Optimization: One of the standout features of AWS TA is its role in cost optimization. It may bring significant savings by identifying and eliminating unused resources, thereby preventing unnecessary expenditures. From forgotten Redshift clusters to inactive EC2 instances, TA helps to trim AWS bills effectively.

Ease of Use for Non-Experts: For users who may not be AWS experts, Trusted Advisor serves as a user-friendly resource. Its basic assessments and clear next steps provide guidance, empowering users to make informed decisions regarding their AWS infrastructure without requiring extensive expertise.

Insightful Recommendations: From security improvements to cost-saving measures, the tool offers practical suggestions that can be implemented to enhance the overall efficiency and security of AWS environments.

Cons:

Repetitive Reports and Duplication of Findings: Some users may express frustration with the repetitive nature of AWS TA reports, particularly the inability to rerun reports with the same parameters easily. Additionally, there are concerns about duplication of findings by other AWS services like Security Hub and Compute Optimizer, leading to questions about the long-term relevance of the product.

Limited User Interface Functionality: While Trusted Advisor offers valuable insights, users desire enhancements to the user interface. There are calls for features that allow for global changes directly from the UI, as well as more out-of-the-box actions to streamline processes, particularly for users lacking deep AWS expertise.

Challenges with Data Extraction and Analysis: Users leveraging AWS Trusted Advisor via the command-line interface express difficulties in data extraction, particularly in listing results per resource. The current format, which lists results by check ID and account, presents obstacles for those seeking granular insights into their AWS environments.

AWS Cost Anomaly Detection

Another tool that can help you identify and investigate unusual spending patterns is AWS Cost Anomaly Detection. It leverages machine learning algorithms to analyze users' historical spending data and automatically detects anomalies or unexpected changes in their AWS usage and costs.

AWS Compute Optimizer

The Compute Optimizer analyzes historical usage metrics and resource utilization patterns of your EC2 instances and Auto Scaling groups. It then uses machine learning algorithms to identify opportunities for optimization, such as selecting the appropriate instance types, identifying underutilized resources, and recommending right-sizing options to match your workload requirements more efficiently.

AWS Compute Optimizer

AWS Compute Optimizer recommendations menu

Pros:

Cost Optimization: It effectively addresses the challenge of cost optimization by analyzing existing EC2 instances and providing tailored recommendations to resize instances appropriately. 

Performance Enhancement: By identifying resource underutilization or overutilization, AWS Compute Optimizer enhances performance. It recommends suitable instance types and sizes, optimizing resource allocation and allowing applications to run more efficiently. This leads to improved application responsiveness and an enhanced end-user experience.

Inclusion in AWS Subscription: AWS Compute Optimizer is included with the AWS subscription, meaning there's no extra fee for accessing this budget-saving and performance-enhancing tool. This makes it accessible and attractive for AWS users who are looking to optimize their cloud operations without incurring additional costs.

Extensive Coverage: The tool doesn't just focus on EC2 instances but also extends its recommendations to auto-scaling groups. This comprehensive coverage ensures that various aspects of an AWS infrastructure are considered for optimization, providing users with a holistic approach to cloud efficiency.

Cons:

Occasional Irrelevant Recommendations: While the optimizer offers valuable recommendations most of the time, there are instances where the suggestions might not fit the user's exact needs. This could lead to occasional irrelevant recommendations that require manual intervention or further customization.

Learning Curve in User Interface: Some users might find the user interface of AWS Compute Optimizer to have a learning curve. Navigating through the tool and understanding its functionalities might require some initial investment in time and effort.

Performance Forecasts as Educated Guesses: The performance forecasts provided by the optimizer are educated guesses rather than guarantees. While they offer insights into potential improvements, users should be aware that these forecasts might not always accurately predict actual outcomes.

AWS Cost Explorer

It enables users to visualize, understand, and manage their AWS spending. Cost Explorer offers a comprehensive set of features for analyzing AWS usage and costs, allowing users to track spending trends, identify cost-saving opportunities, and optimize their cloud expenses.

Key features of AWS Cost Explorer include:

  • Cost Visualization
  • Cost Analysis
  • Forecasting
  • Budgeting and Alerts
  • Recommendations

Step-by-step guide that may help you optimize costs

Although there are a lot of optimization services, there is a set procedure and checks that you can almost guarantee to reduce your AWS costs. 

1. Start with Cost Explorer and Monthly Bill Analysis

  • Utilize Cost Explorer to analyze spending patterns and identify areas of high cost.
  • Group expenses by usage and service to gain a deeper understanding of where money is being spent.

2. Dig into RDS and EC2 Utilization

  • Monitor CPU load and storage associated with RDS to identify underutilized resources.
  • Use CloudWatch metrics to assess CPU and memory load of EC2 instances.
  • Right-size RDS and EC2 instances based on utilization metrics to avoid over-provisioning.

3. Consider Using Spot Instances

  • Evaluate the use of spot instances for cost savings, particularly in regions with ample capacity like us-east and us-west.
  • Set up a mix of instance types to ensure availability and minimize the risk of being booted off.

4. Leverage Cost Explorer and Excel for Optimization

  • Utilize Cost Explorer and Excel to identify low-hanging fruit for cost optimization, such as S3 bucket policies, underutilized resources, and redundant services like multiple CloudTrails.
  • Identify and eliminate underutilized or stale resources, including dev environments and snapshots.

5. Implement Cost Optimization Measures

  • Implement lifecycle policies for S3 buckets to transition data into cold storage.
  • Purchase Reserved Instances (RI) and Savings Plans for long-term commitments and savings.

6. Medium-Term Optimization

  • Implement resource scheduling to power off dev resources during off-hours when they're not needed.
  • Consider breaking workloads into separate accounts and use AWS budgets for cost control.
  • Develop an account baseline to understand the minimum spend for each account.

7. Long-Term Governance and Optimization

  • Separate workloads into different AWS accounts for better governance and cost tracking.
  • Develop and enforce tagging policies for resources to enable context-specific cost analysis.
  • Evaluate the compatibility of your applications with Graviton instances for potential cost savings.

8. Continuous Monitoring and Adjustment

  • Regularly monitor cost and usage metrics using AWS tools.
  • Continuously adjust and optimize resources based on changing workload demands and cost-saving opportunities.

More tips you can try

Consider optimizing your AWS costs further by exploring Graviton instances, especially if your applications are written in interpreted languages like Python or Node.js or use Java without native dependencies. Graviton instances offer a 30% cost reduction and are particularly beneficial for managed services like RDS, where you can enjoy savings without worrying about OS or app dependencies.

Additionally, if you use ECS with your own EC2 instances, disabling container insights can save significantly on CloudWatch Metrics expenses.

Evaluate your need for multi-AZ availability and consider consolidating services to a single AZ to reduce inter-AZ data transfer costs.

Transitioning from x86 to Arm architecture can yield savings of 20-30%, especially for Python-based workloads.

Ensure Lambda functions are optimized for event-driven, async-type workloads to maximize cost efficiency. Address any inefficiencies such as unnecessary sleep() calls to reduce Lambda costs.

Lastly, consider implementing caching mechanisms to minimize costly Aurora IOPS, which can be a significant expense. While optimizing Aurora costs may be challenging, exploring alternatives and optimizing usage can help mitigate expenses associated with this service.

The last few years have seen a real breakthrough in the evolution of cloud technologies. This applies not only to increasing capacity but also to cost optimization. Let's analyze which segments influence the price drop.

Serverless Architecture

Serverless architecture allows you to pay only for computing time, not for maintaining servers that may not be used. In addition, a company can quickly add additional capacity in case of a sudden surge in workload. This flexibility makes the business not only anti-fragile but also has a positive impact on budget spending. After all, you pay only for what you use. Therefore, we are confident that in 2024, more and more companies will use this method to optimize their AWS costs.

AI-based Cost Optimization Tools

Today, artificial intelligence is being actively implemented in various business areas, from risk prediction to text or image generation. Therefore, cost optimization is no exception. AI algorithms can analyze AWS consumption trends and suggest ways to reduce costs. 

We believe that the trend of AI adoption in cost optimization will continue in 2024. 

Ephemeral compute resources

In 2024, the use of temporary computer resources, or so-called ephemeral resources, is another trend that can have a big impact on how well AWS costs are managed. 

These tools are great for tasks like batch processing and data analysis that don't require a lot of computing power all the time. Therefore, they are likely to be used more by businesses as they learn more about their benefits.

Conclusion

To save on AWS costs, start by utilizing AWS's free tier services and choosing the right instance types for your workloads. Implement auto-scaling to adjust resources based on demand, and regularly analyze your usage with AWS Cost Explorer to identify areas for optimization or unused resources to terminate. Additionally, consider using reserved instances or spot instances for predictable workloads or non-critical tasks to further reduce expenses.

Ready to launch your project?

Once we know more about your goals and timeline, we'll start assembling your custom team