AWS Services:
Elastic Compute Cloud (EC2) is a web service that provides secure, resizable compute capacity in the cloud. It is designed to make web-scale cloud computing easier for developers. EC2's simple web service interface allows you to obtain and configure capacity with minimal friction.
Description of the finding:
Downgrade the resources that are not sufficiently used. downgrading to a smaller instance size. If average CPU usage is 0.00. Consider using a smaller instance size as part of Cost Optimization. EC2 instances support multithreading, which enables multiple threads to run concurrently on a single CPU core. Each thread is represented as a virtual CPU (vCPU) on the instance. The number of vCPUs varies according to instance type. Based on the CPU utilization choose the appropriate instance type that matches your environment or requirement. So that no CPU will go underutilized and also it reduces the monthly cost that you are paying for unused resources.
Recommendation:
CPU is underutilized, average CPU usage is 0.00. Consider using a smaller instance size
Use Cloud Watch metrics to get a report of EC2 instances that are either idle or have low CPU utilization, basically which are driving up the cost by wasting the resources. Based on the report we can choose the appropriate instance type that suits your needs.
*Resource information Listed below*
Affected Service Dependencies:
EC2 instances
Elastic Load balancers
Elastic IP
EBS Volumes
Snapshots
Implementation Plan:
Pre Requisites:
Compute info needs to be identified; CPU/Memory/Storage
Approval Required from the client for the downtime of the instance
Check if there is a dependency on the IP address; or if Elastic IP is associated
Make sure all the configurations are noted: KMS Keys; Network related configs; IAM roles
Perform a snapshot of the volume attached to the instance
Current Status: (Check which CPU is underutilized)
Sign in to AWS console
Navigate to EC2 service https://console.aws.amazon.com/ec2/
Click on the Instances, under Instances in the left navigation pane
Select all the instance one by one that you want to examine
Make sure that monitoring is enabled from the details shown below(it can be Basic or Detailed)
Find the underutilized CPUs using the CloudWatch metrics
Navigate to CloudWatch service https://console.aws.amazon.com/cloudwatch/
Click on the metrics in the left navigation pane
- Click on EC2 metrics from metrics shown
- Select the CPUUtilization metric of the instance that you want to examine
After that Choose the graph option as a number, and on the Graph metrics tab in statistics select Average
Once done with the selection, a graph will be shown with the average CPU utilization
If you notice that the CPU utilization is minimum, you can consider using a smaller instance size
Like that, you can get the metrics for n number of instances. From there you can filter the underutilized CPUs
Implementation steps:
Sign in to the AWS Management console
Navigate to EC2 service https://console.aws.amazon.com/ec2/
Click on the Instances, under Instances in the left navigation pane
Select the instance that you want to change
Click on the Instance State on top and select stop Instance from the dropdown options (Note: we can not change the instance type when the instance is running)
- Click on the Actions button on the top and select the Instance settings from the dropdown options
- Click on the Change instance type
- Change instance type window will open and then click on the down arrow, it will show all the instances types available
- For suppose you are currently using the t2.2xlarge instance type, you can change it to t2.medium or any other instance type that has minimal CPUs than the current instance. Refer to this link for details - https://aws.amazon.com/ec2/instance-types/
- Click to Apply
Status after Implementation:
The instance type column of the particular EC2 instance that you changed has to show the type that you selected. Make sure the instance type that you changed is shown in the instance type column.
Back Out Plan: (If you want to rollback to the previous type)
If you want to roll back to the previous instance type at any moment, just follow the steps that you followed in the Implementation steps section, and then in the step where we want to choose instance type, select the previous instance type to roll back.
In case of any data loss or corruption during the process, perform restoration of the volume from the snapshot
Sign in to AWS console; Navigate to EC2 service https://console.aws.amazon.com/ec2/
Click on snapshots under Elastic Block Storage, in the left navigation pane
Select the snapshot that needs to restore from the list of snapshots available in your account and click on the Actions dropdown button and then click on create Volume
Reference:
https://aws.amazon.com/ec2/instance-types/
https://aws.amazon.com/ec2/instance-explorer/