Cost-Effective Cloud: How We Reduced AWS Spend for a Nonprofit

Optimizing AWS EC2 instance selection is a strategic approach to reducing cloud expenses while maintaining performance. This blog takes through our approach to reducing cloud costs through right-sizing techniques, the tools that helped us achieve it, and the positive outcome of the process.

What Affects EC2 Costs: A Breakdown of Key Factors

In our case, the t3.2xlarge instance was underutilized by the resources, which led to inefficiencies and unnecessary costs. The instance was not optimized for the actual workload, highlighting the need for better resource management.

Key Factors Affecting EC2 Cost

  • CPU and Memory Utilization: Selecting the right instance type based on workload and optimizing resource utilization can lead to significant cost savings.
  • Storage Costs: Regularly reviewing storage usage, deleting unused volumes, and selecting cost-efficient storage options are key to controlling these costs.
  • Running Time: Implementing automated start/stop schedules for instances during off-peak times can effectively reduce overall running time and associated costs.
  • Network Usage: Optimizing internal traffic, reducing outbound data, and utilizing AWS regions with lower transfer fees can help mitigate network-related costs.

Braced with this information from Resource Explorer, we knew we had room to reduce costs without affecting the server's performance. The key was selecting a better-suited instance type for the workload.

How to optimize EC2 cost efficiently

  • New users can begin with the AWS free tier, which includes 750 hours of Linux and Windows t2.micro or t3.micro instances.
  • Choosing the saving plans can lead to significant cost-saving opportunities. Users who predict their usage can save up to 72% more than regular plans.
  • Spot Instances gives the user up to 90% discounts, which use Amazon's excess capacity. Many cloud analyst prefers this when the reduction in costs is a priority.
  • Evaluate the most important performance metric of your application. There are multiple instances available combined with features like EBS optimization, and cluster networking. All detailed specifications for Amazon EC2 instances type are available on the EC2 Instance Types Table

Top AWS Cost Optimization Tools in 2024

AWS offers several tools to help with cost optimization associated with Amazon EC2 instances. Here are the tool tools used to reduce the AWS EC2 costs while maintaining the performance.

1.Resource Explorer

Resource Explorer generally serves as a tool within AWS that allows users to discover and manage resources across their AWS environment.
AWS Resource Explorer was invaluable in helping us:

  • Track real-time resource usage.
  • Identify inefficiencies in the instance configuration.
  • Visualize performance metrics that confirm the need for optimization.
  • Ensure that the proposed changes would align with the operational needs.

We could make data-driven decisions that directly contributed to lowering the AWS costs while keeping their infrastructure performance intact.

2.AWS Trusted Advisor

AWS Trusted Advisor is an automatic tool that helps optimize costs, performance, and security. It provides automated optimization recommendations related to,

  • Low utilization of EC2 instances.
  • Underutilized EBS volumes.
  • Unassociated elastic IP addresses.
  • Idle DB instances on Amazon RDS.
  • Idle load balancers.
  • Redundant Route 53 latency resource record sets.

3.AWS Budgets

This tool allows the user to set custom budgets that trigger alerts when cost or usage exceeds a budgeted amount. Budgets can be based on tags and resource types. Its use cases are,

  • Monitoring cost and usage
  • Creating scheduled reports
  • Responding to thresholds

4.Compute Optimizer

To right-size the workload, Compute Optimizer uses a machine learning-based service that analyzes the history of resource consumption metrics to recommend optimal EC2 instance types and configurations. This service targets several

  • AWS resources, including:
  • Amazon EC2 instances
  • Amazon EBS volumes
  • AWS Lambda functions
  • Auto Scaling Groups (ASGs)

5.AWS Instance Scheduler

AWS Instance Scheduler automates the starting and stopping of EC2 instances and RDS instances. Resources that are not in use should be started back up as soon as possible based on the requirement. It functions by using resource tags and AWS Lambda to stop and start instances automatically, and it can be deployed across multiple AWS Regions based on a schedule you define.

Tools we used

We utilized AWS Resource Explorer and AWS Compute Optimizer, both were crucial in identifying inefficiencies and recommending a more cost-effective solution.

With Resource Explorer, we tracked CPU usage on the t3.2xlarge instance and confirmed that it frequently operated at peak capacity, triggering performance issues and additional costs. This insight confirmed the need for a more efficient instance to handle the workload without higher costs.

The Compute Optimizer suggested the most suitable instance based on the workload's requirements. After reviewing the recommendations, it became clear that the t3.large instance would efficiently handle the workload while significantly reducing costs. Compute Optimizer provided insights into potential savings and highlighted the performance trade-offs, which were minimal in this case.

The Switch to t3.large

After analyzing the server’s resource usage, we stopped the t3.2xlarge instance and changed the instance type to t3.large using the AWS Management Console. This process was completed during a maintenance window to prevent any service interruptions. Once restarted, the workload continued running efficiently on the new instance which provided sufficient performance at a significantly lower cost.
The t3.large instance is one of the best AWS EC2 instances for WordPress, especially for websites with moderate traffic, offering a balance of performance and cost efficiency.

Specifications

  • vCPUs: 2
  • Memory: 8 GiB
  • Storage: 300 GB
  • Network Performance: Up to 5 Gbps
  • EBS Optimized: Yes
  • Processor Type: Intel Skylake E5 2686 v5
  • Pricing: Approximately $0.0832 per hour for On-Demand instances

Instance Comparison: t3.2xlarge vs t3.large

Specification t3.2xlarge (Before) t3.large (After) Difference
vCPUs 8 2 6 fewer vCPUs
Memory (GiB) 32 8 24 GiB less
Storage (GB) 300 300 No change
Cost High 37% lesser Cost reduced by 37%

By downsizing to a t3.large instance, we maintained the same 300GB storage but reduced the vCPUs and memory allocation, aligning with the actual workload demands. This switch resulted in a 37% cost reduction while ensuring the website continued to perform efficiently.

Result: The Impact of Right-Sizing

By utilizing AWS Resource Explorer and Compute Optimizer, we successfully optimized the EC2 instance, ensuring that we achieved cost savings while maintaining performance. The transition to the t3.large instance led to a 37% cost reduction while sustaining performance levels. Now, server resources are aligned with the requirements, and AWS bills have been optimized.
Right-sizing instances is a simple yet powerful strategy to cut costs and ensure efficient resource utilization in cloud environments. By leveraging AWS tools effectively, businesses can achieve significant savings while ensuring their applications run smoothly and efficiently.

At Digital Radium, our expert team specializes in web development and performance optimization, helping your business stay efficient and scalable. Get in touch with us today to explore how we can help you streamline your AWS environment and reduce operational costs.

digitalradium

Comments are closed.