Getting to know Amazon Cloudwatch

Introduction

In order to run this lab you will need to have at least one EC2 instance running and have AWS Computer Optimizer enabled at your account.

As highlighted in the 100 level Rightsizing Recommendations lab , rightsizing should be an ongoing effort at your organization and one of the best practices is to measure utilization and test new resource configuration multiple times so you only need to modify it once. The last situation you want is for a new resource type to be uncapable of handling load or functioning incorrectly.

In this lab we will create a custom metric in Amazon CloudWatch and install the CloudWatch agent on one EC2 instance to collect memory utilization. This will help improve the recommendation accuracy of AWS Compute Optimizer. Be aware that custom metrics are not part of the Amazon CloudWatch free tier usage so additional costs will be incurred. For more information read the Amazon CloudWatch pricing page.

Before learning how to capture the memory utilization from a specific resource at your account, let’s first do a quick overview on Amazon CloudWatch.

Getting to know Amazon CloudWatch

The first step to perform rightsizing is to monitor and analyze your current use of services to gain insight into instance performance and usage patterns. 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 i/o.

  1. Log into the AWS console and go to the Amazon CloudWatch service page: Images/CloudWatch01.png

  2. Select Dashboards on the left column, then select Automatic dashboards, followed by EC2: Images/CloudWatch02.png

  3. Observe the Service Dashboard and all of its different metrics: Images/CloudWatch03.png

  4. Select one of the EC2 resources by clicking on the little color icon to the left of the resource-id name: Images/CloudWatch04.png

  5. Deselect the EC2 resource and now modify the time range on the top right, click custom and select the last 2 weeks: Images/CloudWatch05.png

  6. 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:

    1. What is the instance with the lowest CPU Average?
    2. What is the instance with the lowest CPU Max?
    3. What is the instance with the lowest CPU Min?

Images/CloudWatch06.png Images/CloudWatch07.png