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
Let’s baseline the metrics which we can use to measure sustainability improvement once workload optimization is completed. In this section, we will identify:
You will learn more about the following design principles in the AWS Well-Architected Sustainability Pillar:
Let’s understand the resources provisioned to support your workload including compute, storage, and network resources. Then, evaluate the resources provisioned using your proxy metrics to see how those resources are consumed.
From the Amazon CloudWatch console, expand Metrics and click All metrics. In Custom namespaces, there will be a new namespace named Sustainability. Click Sustainability.
Tick a box to see if you see a total number of vCPU of Amazon EC2 Instance you just deployed. It will be 4 as expected. It will be used for proxy metrics that best reflect the type of improvement you are accessing and the resources targeted for improvement.
Your business metrics should reflect the value provided by your workload, for example, the number of simultaneously active users, API calls served, or the number of transactions completed.
Within the Amazon CloudWatch console, click Log groups and click httpd_access_log that records all inbound requests handled by HTTP endpoints.
Click Metric filters tab.
You will define business metrics to quantify the achievement of business outcome. Click Create metric filter button to monitor a specific pattern in the access log.
You now need to define the pattern to monitor the number of requests of businessapi.php page that is a critical for your business. Specify “GET /businessapi.php” as a filter pattern to match it in the access log as shown.
"GET /businessapi.php"
Select log as your_EC2_instance_id/var/log/httpd/access_log to test and click Test pattern button. You should be able to see 3 http requests per minute.
Scroll down to the bottom to click Next.
Provide the metric details.
businessapi.php
BusinessMetrics
Review all values and click create metric filter.
Click BusinessMetrics to see the metrics you created previously.
Click Sustainability > Metrics with no dimensions.
Tick a box to see the number of units of “GET /businessapi.php” is being monitored. It may take a few minutes for metrics to be displayed on the graph.
Our improvement goal is to maximize utilization of provisioned resources. Let’s create the metrics for KPIs to evaluate ways to improve productivity and estimate the impact of proposed changes over time.
Click Dashboards
Click create dashboard button.
For the dashboard name, use SustainabilityApp-KPI and click the Create dashboard button.
Select Line as a widget type.
Select Metrics.
Select Sustainability in custom namespaces.
Select Instance.
Tick a box to select your EC2 Instance ID where SustainabilityApp is running and click Sustainatility metrics to go back.
Now let’s add business metrics. Click Metrics with no dimensions.
Tick a box to select BusinessMetrics at step 3.2 and select Graphed metrics tab.
Let’s change the statistic and period setting as shown:
We are going to use CloudWatch metrics with metric math function.
The following formula divides the provisioned resources by the business outcomes achieved to determine the provisioned resources per unit of work.
Formula:
Resources provisioned per unit of work = Total number of vCPU minutes / The number of API requests per minute
Then, edit math expression as follows and click Apply.
m1/m2
Click Expression and use Resources provisioned per unit of work. Click Apply and Create widget.
Resources provisioned per unit of work
Click Save button to continuously monitor KPIs after reducing idle resources and maximizing utilization in the next step. You will use Resources provisioned per unit of work as sustainability KPIs.
These are the improved metrics and KPIs:
* Proxy Metric - Total number of vCPUs = 4
* Business Metric - Total number of APIs = 3
* KPIs - Resources provisioned per unit of work = 4 / 3 requests = 1.333
Sustainability KPIs Baseline appears to be 1.33333
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