
Rightsizing Your AWS Estate - Part 2
In our previous blog post, we discussed the concept of rightsizing and how it can help you optimize your AWS resources and reduce costs. We also talked about the importance of identifying overprovisioned resources, and the benefits of rightsizing in general.
In this blog post, we will be focusing specifically on EC2 rightsizing. We will be diving deeper into the different methods and tools available for rightsizing EC2 instances, and providing tips and best practices for maximizing your savings.
We will start by discussing the different ways to identify underutilized EC2 instances, either by usage performance or needs. We will also discuss the different rightsizing methods available, before getting into some of the main AWS services you can leverage in achieving your rightsizing goals.
We’ll focus on a step-by-step guide on doing this on your management console to give some of our AWS newbies who are just trying out AWS Free Tier a way of keeping their costs under control.
By the end of this blog post, you will have a better understanding of how to rightsize your EC2 instances, and how to reduce costs while improving performance. Whether you are new to AWS or a seasoned user, this post will provide valuable insights and actionable steps to help you optimize your EC2 resources and achieve the best results from your AWS estate.
EC2 Instance Rightsizing
Amazon EC2 provides different instance types optimized to fit different use cases. Instance types comprise varying combinations of CPU, memory, storage, and networking capacity which gives you the flexibility to choose the appropriate mix of resources for your applications. Each instance type includes one or more instance sizes, allowing you to scale your resources to the requirements of your target workload.
How To Rightsize Your EC2 Instances
- Right Size Using Performance Data
Analyze performance data to right size your EC2 instances. Identify idle instances and ones that are underutilized. Key metrics to look for are CPU usage and memory usage. Identify instances with a maximum CPU usage and memory usage of less than 40% over a four-week period. You can analyse for compute-optimized instances and storage-optimized instances (I2 and D2 instance types). - Right Size Based on Usage Needs
As you monitor current performance, identify the following usage needs and patterns so that you can take advantage of potential right-sizing options: - Steady state
The load remains at a relatively constant level over time, and you can accurately forecast the likely compute load. For this usage pattern, you might consider Reserved Instances, which can provide significant savings. - Variable, but predictable
The load changes, but on a predictable schedule. Auto Scaling is well suited for applications that have stable demand patterns with hourly, daily, or weekly variability in usage. You can use this feature to scale Amazon EC2 capacity up or down when you experience spiky traffic or predictable fluctuations in traffic. - Dev/test/production
Development, testing, and production environments are typically used only during business hours and can be turned off during evenings, weekends, and holidays. (You’ll need to rely on tagging to identify dev/test/production instances.) - Temporary
For temporary workloads that have flexible start times and can be interrupted, you can consider placing a bid for an Amazon EC2 Spot Instance instead of using an On-Demand Instance.
Rightsizing Steps & Tools
- Right Size by Turning Off Idle Instances
It’s not uncommon for companies, due to lack of governance and control, to have resources that were launched and forgotten. As a matter of fact, an estimated $14.5B was wasted on idle cloud resources last year. - Switching off Idle EC2 Instances
Where you find instances that have been idle for more than a week, it’s safe to stop or even remove them. Consider which user owns the instance, the potential impact of removing the instance and how hard will it be to re-create the instance if you need to restore it before removing an instance.
Another simple way to reduce costs is to stop instances used in development and production during off work hours and start them again when needed. Assuming a 50-hour work week, you can save 70% by automatically stopping non production instances during non-business hours. You can use Amazon EC2 Scheduler to automate scheduling but this requires some level of AWS expertise to achieve.
Also note that stopping an EC2 instance leaves any attached EBS volumes operational. You will continue to be charged for these volumes until you delete them. If you need the instance again, you can easily turn it back on. - Reprovisioning right sized instances
Provisioning instances to match workloads however, automatically deletes attached EBS volumes and requires effort to reprovision should the instance be needed again. If you decide to delete an EBS volume, consider storing a snapshot of the volume so that it can be restored later if needed, - Right Size by Selecting the Right Instance Family
You can right size an instance by migrating to a different model within the same instance family or by migrating to another instance family. When migrating within the same instance family, you only need to consider vCPU, memory, network throughput, and ephemeral storage.
A good, general rule for EC2 instances is that if your maximum CPU and memory usage is less than 40% over a four-week period, you can safely cut the machine in half.
When you rightsize an EC2 instance, the right sized instance usually has the same number of instance store volumes that you specified when you launched the original instance. You cannot attach instance store volumes to an instance after you’ve launched it, so if you want to add instance store volumes, you will need to migrate to a new instance type that contains the higher number of volumes.
Rightsizing Tools
There are several AWS services that can help you achieve your rightsizing goals. Some of the main services include:
- AWS Trusted Advisor:Provides best practices and optimization recommendations for your AWS resources, including EC2 instances, storage, and more. It also includes a check for EC2 instances - Underutilized, which can help you identify instances that are over or under-allocated, and recommend the appropriate instance size.
- AWS Cost Explorer: A cost management tool that allows you to visualize, understand, and manage your AWS costs and usage. You can use it to analyze your costs by service, usage type, and more, and identify resources that are underutilized or over-allocated.
- AWS Auto Scaling: Allows you to automatically scale your Amazon EC2 capacity up or down according to predefined conditions, helping you to ensure that your instances are the right size for your workloads.
- AWS Systems Manager Automation: Allows you to automate common maintenance and deployment tasks, such as change management, patching, and resource provisioning, helping you to optimize your AWS resources and reduce costs.
Wendu, Your Rightsizing Tool
We talked about monitoring your resource usage and performance over a period of time, and making use of services such as the Amazon Instance Scheduler and Trusted Advisor for your EC2 Recommendations. While the Instance Scheduler is a free service, you’ll need DevOps expertise to implement it via your CloudFormation scripts on your Management Console; and the EC2 recommendations can be assessed on AWS accounts that have purchased premium support via the Trusted Advisor support plan.
With Wendu, your instance scheduler process is made as simple as ABC, and in one filled form, you can have your EC2 and RDS instances scheduled without the hassle of going through running a CloudFormation script per instance; while you can get your EC2 recommendations in Wendu at no extra charge on your AWS account or support plan.
Wendu’s EC2 Recommendation
Wendu’s EC2 & RDS Instance Scheduler
Wendu SME & Startup Package
At Wendu, we understand how cost intensive achieving cloud security is for SMEs and Startups, albeit, how important it is to do so. Because of this, we’ve created a special SME and Startup package where we can become long-term cloud security partners that fit into your SME and Startup budgets.
To learn more about Wendu’s SME and Startup package, you can contact us here, with the message ‘Wendu SME and Startup Package’; or if you’d like to learn more about Wendu through a demo, you can request for one here, and we’ll definitely reach out to you in less than 12 hours of your request.