NOTE: In order to run this lab you will need to have at least one EC2 instance running and have AWS Cost Explorer and Amazon EC2 Resource Optimization enabled.
During this lab we will create a custom metric at Amazon CloudWatch and install an agent in one EC2 instance to start collecting Memory utilization and improve the recommendation accuracy of the Amazon EC2 Resource Optimization report. Be aware that custom metrics are not part of the Amazon CloudWatch free tier usage so additional costs will incur at your bill. For more information read the Amazon CloudWatch pricing page.
All custom metrics charges are prorated by the hour and metered only when you send metrics to Amazon CloudWatch. Each custom metrics costs $0.30 per metric/month for the first 10,000 metrics and can go down to $0.02 per metric/month at the lowest priced tier (US Virginia prices from November 2019).
The first step to perform right sizing is to monitor and analyze your current use of services to gain insight into instance performance and usage patterns. To gather sufficient data, observe performance over at least a two-week period (ideally, over a one-month period) to capture the workload and business peak. The most common metrics that define instance performance are vCPU utilization, memory utilization, network utilization, and disk use.
Log into your AWS console, go to the Amazon CloudWatch service page:
Select EC2 under the Service Dashboard:
Observe the Service Dashboard and all of its different metrics, but focus on CPU Utilization and Network In and Out:
Select one of the EC2 resources by clicking on the little color icon to the left of the resource-id name:
Deselect the EC2 resource and now modify the time range on the top right, click custom and select the last 2 weeks:
Navigate to the CPU Utilization Average widget and launch the View Metrics detailed page. Using the Graphed metrics session try to answer the following questions: