Lab complete!
Now that you have completed this lab, make sure to update your Well-Architected review if you have implemented these changes in your workload.
Click here to access the Well-Architected Tool
As per the previous section of the lab, our sustainability improvement goals are:
This section of the lab will allow you to learn more about the following design principles in the AWS Well-Architected Sustainability Pillar documentation:
You will improve the sustainability KPIs by optimizing the following hardware patterns:
We will now use the AWS Compute Optimizer service to rightsize your EC2 resources. AWS Compute Optimizer uses a combination of machine learning and historical trend information to provide efficiency recommendations for your workload. Follow the steps below to rightsize your compute environment:
Note - To see recommendations from the AWS Compute Optimizer dashboard, you will need to let your Amazon EC2 Instance run for 42 hours, which will incur costs generated from EC2(t4g.xlarge) in your AWS account. You can refer to the screenshots in this lab to minimize costs from EC2.
Search for compute optimizer in AWS console and select AWS Compute Optimizer from Services.
Scroll down to the bottom of the dashboard and click View Recommendations as shown:
As you can see, AWS Compute Optimizer has evaluated the EC2 instance for SustainabilityApp as over-provisioned. It is therefore possible to rightsize the instance while still meeting the performance requirements of your workload. Click Over-provisioned to see more details.
Please see three finding classifications here
.
Based on the workload for the past 12 hours, AWS Compute Optimizer recommends that 2 vCPUs with 4 GiB memory are optimal compute resources to deliver your business outcomes.
The CPU utilization graph compares the CPU utilization data of your current instance type against the recommended instance type. It appears to be 13% CPU utilization with current t4g.xlarge instance. If you replaced it with c6g.large, you would estimate 28% of the CPU utilization.
We will now action the recommendations which were given to us by the AWS Compute Optimizer, changing our existing t4g.xlarge instance type for a c6g.large. Complete the following steps to action the instance type change:
You can get the CloudFormation template here.
The second CloudFormation template will replace your current instance with c6g.large. You can create a CloudFormation Stack directly via the AWS console.
If you need detailed instructions on how to deploy a CloudFormation stack from within the console, please follow this guide.
Open the CloudFormation console at https://console.aws.amazon.com/cloudformation and select the correct region you used to deploy this lab.
Select the previous CloudFormation stack you deployed and click Update.
Select Replace current template and Upload a template file. Click Choose file to upload SustainabilityDemo-c6g.yaml. Then Click Next.
Click Next.
Scroll down to the bottom to click Next.
Scroll down to the bottom of the stack creation page and acknowledge the IAM resources creation by selecting all the check boxes. Then click Update stack. It may take 3 minutes to replace EC2 instance.
Search for EC2 service in AWS console and click EC2 from Services.
You have now actioned the recommended changes from AWS Compute Optimizer, replacing your existing t4g.xlarge instance with c6g.large. The previous sustainability KPIs which we calculated will now have been automatically updated.
Wait for 5~10 minutes to see CPU utilization.
In this section, you successfully replaced t4g.xlarge with c6g.large using the second AWS CloudFormation template of the lab. You generated API calls in a replaced Amazon EC2 instance. We will use these newer metrics next to review the improvements against our sustainability KPI.
Click on Next Step to continue to the next section.
Now that you have completed this lab, make sure to update your Well-Architected review if you have implemented these changes in your workload.
Click here to access the Well-Architected Tool