Cloud

20 Easy Ways to Optimize Expenses on AWS and Save Over 80% of Your Budget

0 Easy Ways to Optimize AWS Costs and Save Over 80% of Your Budget

In my experience optimizing cloud costs, especially on AWS, I often find that many quick wins are in the “easy to implement – good savings potential” quadrant.

That’s why I’ve decided to share some straightforward methods for optimizing expenses on AWS that will help you save over 80% of your budget.

Choose reserved instances

Potential Savings: Up to 72%

Choosing reserved instances involves committing to a subscription, even partially, and offers a discount for long-term rentals of one to three years. While planning for a year is often deemed long-term for many companies, especially in Ukraine, reserving resources for 1-3 years carries risks but comes with the reward of a maximum discount of up to 72%.

You can check all the current pricing details on the official website – Amazon EC2 Reserved Instances

Purchase Saving Plans (Instead of On-Demand)

Potential Savings: Up to 72%

There are three types of saving plans: Compute Savings Plan, EC2 Instance Savings Plan, SageMaker Savings Plan.

AWS Compute Savings Plan is an Amazon Web Services option that allows users to receive discounts on computational resources in exchange for committing to using a specific volume of resources over a defined period (usually one or three years). This plan offers flexibility in utilizing various computing services, such as EC2, Fargate, and Lambda, at reduced prices.

AWS EC2 Instance Savings Plan is a program from Amazon Web Services that offers discounted rates exclusively for the use of EC2 instances. This plan is specifically tailored for the utilization of EC2 instances, providing discounts for a specific instance family, regardless of the region.

AWS SageMaker Savings Plan allows users to get discounts on SageMaker usage in exchange for committing to using a specific volume of computational resources over a defined period (usually one or three years).

The discount is available for one and three years with the option of full, partial upfront payment, or no upfront payment. EC2 can help save up to 72%, but it applies exclusively to EC2 instances.

Utilize Various Storage Classes for S3 (Including Intelligent Tier)

Potential Savings: 40% to 95%

AWS offers numerous options for storing data at different access levels. For instance, S3 Intelligent-Tiering automatically stores objects at three access levels: one tier optimized for frequent access, 40% cheaper tier optimized for infrequent access, and 68% cheaper tier optimized for rarely accessed data (e.g., archives).

S3 Intelligent-Tiering has the same price per 1 GB as S3 Standard — $0.023 USD.

However, the key advantage of Intelligent Tiering is its ability to automatically move objects that haven’t been accessed for a specific period to lower access tiers.

Every 30, 90, and 180 days, Intelligent Tiering automatically shifts an object to the next access tier, potentially saving companies from 40% to 95%. This means that for certain objects (e.g., archives), it may be appropriate to pay only $0.0125 USD per 1 GB or $0.004 per 1 GB compared to the standard price of $0.023 USD.

Utilize Various Storage Classes for S3 (Including Intelligent Tier)

Information regarding the pricing of Amazon S3

AWS Compute Optimizer

Potential Savings: quite significant

The AWS Compute Optimizer dashboard is a tool that lets users assess and prioritize optimization opportunities for their AWS resources.

Regularly check the optimization level dashboard - AWS Compute Optimizer

The dashboard provides detailed information about potential cost savings and performance improvements, as the recommendations are based on an analysis of resource specifications and usage metrics.

dashboard provides detailed information

The dashboard covers various types of resources, such as EC2 instances, Auto Scaling groups, Lambda functions, Amazon ECS services on Fargate, and Amazon EBS volumes.

For example, AWS Compute Optimizer reproduces information about underutilized or overutilized resources allocated for ECS Fargate services or Lambda functions. Regularly keeping an eye on this dashboard can help you make informed decisions to optimize costs and enhance performance.

AWS Compute Optimizer reproduces information
 ECS Fargate services or Lambda functions

Use Fargate in EKS for underutilized EC2 nodes

If your EKS nodes aren’t fully used most of the time, it makes sense to consider using Fargate profiles. With AWS Fargate, you pay for a specific amount of memory/CPU resources needed for your POD, rather than paying for an entire EC2 virtual machine.

For example, let’s say you have an application deployed in a Kubernetes cluster managed by Amazon EKS (Elastic Kubernetes Service). The application experiences variable traffic, with peak loads during specific hours of the day or week (like a marketplace or an online store), and you want to optimize infrastructure costs. To address this, you need to create a Fargate Profile that defines which PODs should run on Fargate. Configure Kubernetes Horizontal Pod Autoscaler (HPA) to automatically scale the number of POD replicas based on their resource usage (such as CPU or memory usage).

Manage Workload Across Different Regions

Potential Savings: significant in most cases

When handling workload across multiple regions, it’s crucial to consider various aspects such as cost allocation tags, budgets, notifications, and data remediation.

  1. Cost Allocation Tags: Classify and track expenses based on different labels like program, environment, team, or project.
  2. AWS Budgets: Define spending thresholds and receive notifications when expenses exceed set limits. Create budgets specifically for your workload or allocate budgets to specific services or cost allocation tags.
  3. Notifications: Set up alerts when expenses approach or surpass predefined thresholds. Timely notifications help take actions to optimize costs and prevent overspending.
  4. Remediation: Implement mechanisms to rectify expenses based on your workload requirements. This may involve automated actions or manual interventions to address cost-related issues.
  5. Regional Variances: Consider regional differences in pricing and data transfer costs when designing workload architectures.
  6. Reserved Instances and Savings Plans: Utilize reserved instances or savings plans to achieve cost savings.
  7. AWS Cost Explorer: Use this tool for visualizing and analyzing your expenses. Cost Explorer provides insights into your usage and spending trends, enabling you to identify areas of high costs and potential opportunities for cost savings.

Transition to Graviton (ARM)

Potential Savings: Up to 30%

Graviton utilizes Amazon’s server-grade ARM processors developed in-house. The new processors and instances prove beneficial for various applications, including high-performance computing, batch processing, electronic design automation (EDA) automation, multimedia encoding, scientific modeling, distributed analytics, and machine learning inference on processor-based systems.

The processor family is based on ARM architecture, likely functioning as a system on a chip (SoC). This translates to lower power consumption costs while still offering satisfactory performance for the majority of clients. Key advantages of AWS Graviton include cost reduction, low latency, improved scalability, enhanced availability, and security.

Spot Instances Instead of On-Demand

Potential Savings: Up to 30%

Utilizing spot instances is essentially a resource exchange. When Amazon has surplus resources lying idle, you can set the maximum price you’re willing to pay for them. The catch is that if there are no available resources, your requested capacity won’t be granted.

However, there’s a risk that if demand suddenly surges and the spot price exceeds your set maximum price, your spot instance will be terminated.

Spot instances operate like an auction, so the price is not fixed. We specify the maximum we’re willing to pay, and AWS determines who gets the computational power. If we are willing to pay $0.1 per hour and the market price is $0.05, we will pay exactly $0.05.

Use Interface Endpoints or Gateway Endpoints to save on traffic costs (S3, SQS, DynamoDB, etc.)

Potential Savings: Depends on the workload

Interface Endpoints operate based on AWS PrivateLink, allowing access to AWS services through a private network connection without going through the internet. By using Interface Endpoints, you can save on data transfer costs associated with traffic.

Utilizing Interface Endpoints or Gateway Endpoints can indeed help save on traffic costs when accessing services like Amazon S3, Amazon SQS, and Amazon DynamoDB from your Amazon Virtual Private Cloud (VPC).

Key points:

  1. Amazon S3: With an Interface Endpoint for S3, you can privately access S3 buckets without incurring data transfer costs between your VPC and S3.
  2. Amazon SQS: Interface Endpoints for SQS enable secure interaction with SQS queues within your VPC, avoiding data transfer costs for communication with SQS.
  3. Amazon DynamoDB: Using an Interface Endpoint for DynamoDB, you can access DynamoDB tables in your VPC without incurring data transfer costs.

Additionally, Interface Endpoints allow private access to AWS services using private IP addresses within your VPC, eliminating the need for internet gateway traffic. This helps eliminate data transfer costs for accessing services like S3, SQS, and DynamoDB from your VPC.

Optimize Image Sizes for Faster Loading

Potential Savings: Depends on the workload

Optimizing image sizes can help you save in various ways.

  1. Reduce ECR Costs: By storing smaller instances, you can cut down expenses on Amazon Elastic Container Registry (ECR).
  2. Minimize EBS Volumes on EKS Nodes: Keeping smaller volumes on Amazon Elastic Kubernetes Service (EKS) nodes helps in cost reduction.
  3. Accelerate Container Launch Times: Faster container launch times ultimately lead to quicker task execution.

Optimization Methods:

  1. Use the Right Image: Employ the most efficient image for your task; for instance, Alpine may be sufficient in certain scenarios.
  2. Remove Unnecessary Data: Trim excess data and packages from the image.
  3. Multi-Stage Image Builds: Utilize multi-stage image builds by employing multiple FROM instructions.
  4. Use .dockerignore: Prevent the addition of unnecessary files by employing a .dockerignore file.
  5. Reduce Instruction Count: Minimize the number of instructions, as each instruction adds extra weight to the hash. Group instructions using the && operator.
  6. Layer Consolidation: Move frequently changing layers to the end of the Dockerfile.

These optimization methods can contribute to faster image loading, reduced storage costs, and improved overall performance in containerized environments.

Use Load Balancers to Save on IP Address Costs

Potential Savings: depends on the workload

Starting from February 2024, Amazon begins billing for each public IPv4 address. Employing a load balancer can help save on IP address costs by using a shared IP address, multiplexing traffic between ports, load balancing algorithms, and handling SSL/TLS.

By consolidating multiple services and instances under a single IP address, you can achieve cost savings while effectively managing incoming traffic.

Use Load Balancers to Save on IP Address Costs

Optimize Database Services for Higher Performance (MySQL, PostgreSQL, etc.)

Potential Savings: depends on the workload

AWS provides default settings for databases that are suitable for average workloads. If a significant portion of your monthly bill is related to AWS RDS, it’s worth paying attention to parameter settings related to databases.

Some of the most effective settings may include:

  1. Use Database-Optimized Instances: For example, instances in the R5 or X1 class are optimized for working with databases.
  2. Choose Storage Type: General Purpose SSD (gp2) is typically cheaper than Provisioned IOPS SSD (io1/io2).
  3. AWS RDS Auto Scaling: Automatically increase or decrease storage size based on demand.

If you can optimize the database workload, it may allow you to use smaller instance sizes without compromising performance.

Regularly Update Instances for Better Performance and Lower Costs

Potential Savings: Minor

As Amazon deploys new servers in their data processing centers to provide resources for running more instances for customers, these new servers come with the latest equipment, typically better than previous generations. Usually, the latest two to three generations are available. Make sure you update regularly to effectively utilize these resources.

Take Memory Optimize instances, for example, and compare the price change based on the relevance of one instance over another. Regular updates can ensure that you are using resources efficiently.

InstanceGenerationDescriptionOn-Demand Price (USD/hour)
m6g.large6thInstances based on ARM processors offer improved performance and energy efficiency.$0.077
m5.large5thGeneral-purpose instances with a balanced combination of CPU and memory, designed to support high-speed network access.$0.096
m4.large4thA good balance between CPU, memory, and network resources.$0.1
m3.large3rdOne of the previous generations, less efficient than m5 and m4.Not avilable

Use RDS Proxy to reduce the load on RDS

Potential for savings: Low

RDS Proxy is used to relieve the load on servers and RDS databases by reusing existing connections instead of creating new ones. Additionally, RDS Proxy improves failover during the switch of a standby read replica node to the master.

Imagine you have a web application that uses Amazon RDS to manage the database. This application experiences variable traffic intensity, and during peak periods, such as advertising campaigns or special events, it undergoes high database load due to a large number of simultaneous requests.

During peak loads, the RDS database may encounter performance and availability issues due to the high number of concurrent connections and queries. This can lead to delays in responses or even service unavailability.

RDS Proxy manages connection pools to the database, significantly reducing the number of direct connections to the database itself.

By efficiently managing connections, RDS Proxy provides higher availability and stability, especially during peak periods.

Using RDS Proxy reduces the load on RDS, and consequently, the costs are reduced too.

Define the storage policy in CloudWatch

Potential for savings: depends on the workload, could be significant.

The storage policy in Amazon CloudWatch determines how long data should be retained in CloudWatch Logs before it is automatically deleted.

Setting the right storage policy is crucial for efficient data management and cost optimization. While the “Never” option is available, it is generally not recommended for most use cases due to potential costs and data management issues.

Typically, best practice involves defining a specific retention period based on your organization’s requirements, compliance policies, and needs.

Avoid using an undefined data retention period unless there is a specific reason. By doing this, you are already saving on costs.

Configure AWS Config to monitor only the events you need

Potential for savings: depends on the workload

AWS Config allows you to track and record changes to AWS resources, helping you maintain compliance, security, and governance. AWS Config provides compliance reports based on rules you define. You can access these reports on the AWS Config dashboard to see the status of tracked resources.

You can set up Amazon SNS notifications to receive alerts when AWS Config detects non-compliance with your defined rules. This can help you take immediate action to address the issue. By configuring AWS Config with specific rules and resources you need to monitor, you can efficiently manage your AWS environment, maintain compliance requirements, and avoid paying for rules you don’t need.

Use lifecycle policies for S3 and ECR

Potential for savings: depends on the workload

S3 allows you to configure automatic deletion of individual objects or groups of objects based on specified conditions and schedules. You can set up lifecycle policies for objects in each specific bucket. By creating data migration policies using S3 Lifecycle, you can define the lifecycle of your object and reduce storage costs.

These object migration policies can be identified by storage periods. You can specify a policy for the entire S3 bucket or for specific prefixes. The cost of data migration during the lifecycle is determined by the cost of transfers. By configuring a lifecycle policy for ECR, you can avoid unnecessary expenses on storing Docker images that you no longer need.

Switch to using GP3 storage type for EBS

Potential for savings: 20%

By default, AWS creates gp2 EBS volumes, but it’s almost always preferable to choose gp3 — the latest generation of EBS volumes, which provides more IOPS by default and is cheaper.

For example, in the US-east-1 region, the price for a gp2 volume is $0.10 per gigabyte-month of provisioned storage, while for gp3, it’s $0.08/GB per month. If you have 5 TB of EBS volume on your account, you can save $100 per month by simply switching from gp2 to gp3.

Switch the format of public IP addresses from IPv4 to IPv6

Potential for savings: depending on the workload

Starting from February 1, 2024, AWS will begin charging for each public IPv4 address at a rate of $0.005 per IP address per hour. For example, taking 100 public IP addresses on EC2 x $0.005 per public IP address per month x 730 hours = $365.00 per month.

While this figure might not seem huge (without tying it to the company’s capabilities), it can add up to significant network costs. Thus, the optimal time to transition to IPv6 was a couple of years ago or now.

Here are some resources about this recent update that will guide you on how to use IPv6 with widely-used services — AWS Public IPv4 Address Charge.

Collaborate with AWS professionals and partners for expertise and discounts

Potential for savings: ~5% of the contract amount through discounts.

AWS Partner Network (APN) Discounts: Companies that are members of the AWS Partner Network (APN) can access special discounts, which they can pass on to their clients. Partners reaching a certain level in the APN program often have access to better pricing offers.

Custom Pricing Agreements: Some AWS partners may have the opportunity to negotiate special pricing agreements with AWS, enabling them to offer unique discounts to their clients. This can be particularly relevant for companies involved in consulting or system integration.

Reseller Discounts: As resellers of AWS services, partners can purchase services at wholesale prices and sell them to clients with a markup, still offering a discount from standard AWS prices. They may also provide bundled offerings that include AWS services and their own additional services.

Credit Programs: AWS frequently offers credit programs or vouchers that partners can pass on to their clients. These could be promo codes or discounts for a specific period.

Seek assistance from AWS professionals and partners. Often, this is more cost-effective than purchasing and configuring everything independently. Given the intricacies of cloud space optimization, expertise in this matter can save you tens or hundreds of thousands of dollars.

More valuable tips for optimizing costs and improving efficiency in AWS environments:

  1. Scheduled TurnOff/TurnOn for NonProd environments: If the Development team is in the same timezone, significant savings can be achieved by, for example, scaling the AutoScaling group of instances/clusters/RDS to zero during the night and weekends when services are not actively used.
  2. Move static content to an S3 Bucket & CloudFront: To prevent service charges for static content, consider utilizing Amazon S3 for storing static files and CloudFront for content delivery.
  3. Use API Gateway/Lambda/Lambda Edge where possible: In such setups, you only pay for the actual usage of the service. This is especially noticeable in NonProd environments where resources are often underutilized.
  4. If your CI/CD agents are on EC2, migrate to CodeBuild: AWS CodeBuild can be a more cost-effective and scalable solution for your continuous integration and delivery needs.
  5. CloudWatch covers the needs of 99% of projects for Monitoring and Logging: Avoid using third-party solutions if AWS CloudWatch meets your requirements. It provides comprehensive monitoring and logging capabilities for most projects.

Feel free to reach out to me or other specialists for an audit, a comprehensive optimization package, or just advice.

FAQ

What are the key areas for optimizing costs on AWS?

Key areas for cost optimization on AWS include resource right-sizing, choosing the right instance types, leveraging reserved instances, and managing storage costs effectively.

Why is using CloudWatch for monitoring and logging recommended for cost efficiency?

CloudWatch provides a cost-effective solution for monitoring and logging, covering the needs of most projects and eliminating the need for additional third-party solutions, which can result in additional costs.

What role do AWS Partner Network (APN) and AWS partners play in cost optimization?

APN and AWS partners can offer discounts, custom pricing, and other incentives, potentially resulting in cost savings of around 5% on the total contract value.

How can I optimize storage costs on AWS?

Optimize storage costs by regularly reviewing and deleting unused resources, choosing the right storage classes, and leveraging S3 lifecycle policies for data management.

What are some best practices for overall cost governance on AWS?

Best practices include regular monitoring and analysis of costs, utilizing AWS Cost Explorer for insights, setting up billing alerts, and leveraging automation for resource management.
arrow arrow

Thank you
for contacting us!

Please, check your email

arrow arrow

Thank you

You've been subscribed

We use cookies to enhance your browsing experience. By clicking "Accept," you consent to the use of cookies. To learn more, read our Privacy Policy