In a cloud-based environment, it’s important to optimize your costs by ensuring that your computing demands closely match your allocated resources.
If your team is using AWS, one way to lower your costs is by finding EC2 instances that are using a low amount of computing power relative to their capacity.
By monitoring your low CPU usage and identifying which EC2 instances run low and high, you're better positioned to redeploy your computing resources more effectively and efficiently using Amazon's well-architected framework.
This framework helps structure your opportunities to reduce costs by aligning computing resources according to type, task, and size with your workload requirements.
In a nutshell, CPU usage represents what percentage of the amount of time a CPU spends processing non-idle tasks. That means low CPU usage represents a low percentage of the amount of time to process a given set of tasks at a given period (i.e. low utilization rate). As such, low CPU utilization is an indication of inadequate computing resource management.
AWS recommends looking for EC2 instances that have a maximum CPU usage and memory usage of less than 40% over a four-week period.
Performance data offers great insights to identify which computing resources are over- or underutilized. To analyze performance data, certain metrics are useful to inform your analysis about whether actual usage is lower compared to instance capacity, including:
- Avg. CPU utilization
- Max. CPU utilization
- Min. available RAM
- Avg. number of bytes read from disk per sec
- Avg. number of bytes written to disk per sec
To find these metrics, you can start in the Amazon EC2 console and choose “Instances” in the navigation menu. You can then select a specific instance and view metrics like CPU utilization on the “Monitoring” tab.
After you’ve reviewed metrics for your EC2 instances, you can make decisions on resizing based on how the instance is being used.
If the instance is operating at a relatively constant level and is predictable, you could decide to instead use Reserved Instances (RIs), which are less expensive to run.
If the load is variable but predictable, then you should ensure that Auto Scaling is configured so you automatically scale down when the demand is low.
If the instances are related to a temporary project, then bidding on EC2 Spot Instances instead of On-Demand instances could result in up to a 90% discount for your organization.
In migrating within the same instance family, you only need to consider vCPU, memory, network throughput, and ephemeral storage. If you are migrating across instance families, you also need to consider compatibility in virtualization type, network, and platform.
If you identify idle EC2 instances which haven’t been used in two weeks or more, you should consider turning it off to lower your costs.
You can make this decision depending on the organizational impact of terminating the instance, who owns it, and whether you will incur costs if you re-provision the instance in the future. If you decide to terminate the instance, you might want to store a snapshot of the attached EBS volume so you can restore it later, and delete the EBS volume in the meanwhile.
If you don’t delete the EBS volume when you terminate the EC2 instance, it will continue to be charged against your account.
We recently wrote a guide on how you can find and delete unattached EBS volumes.
As we mentioned earlier, if you are seeing low usage (less than 40% maximum CPU and memory usage over the last four-weeks) and you believe you are using the right type of instance, you can select a smaller instance size.
For example, if you are using a c4.8large EC2, you could save roughly $600/month by resizing to a c4.4xlarge EC2.
As your business and engineering requirements evolve against internal operational needs and external market developments, your resizing efforts should be just as agile.
Whether you want to aggregate reports on your CPU usage or navigate instance migrations, having an easy way to navigate the steps is critical.
When you create a free Blink account, you can automate this specific usage check and use no-code/low-code automations to manage and customize your resizing process.
Create your free Blink account and start automating this task today.