By using AWS re:Post, you agree to the Terms of Use
/Is 'cpu_usage_active' calculated by CloudWatch agent same as CPUUtilization under AWS/ECS namespace?/

Is 'cpu_usage_active' calculated by CloudWatch agent same as CPUUtilization under AWS/ECS namespace?

0

Hi,

I am currently trying to create a custom metric based on CPUUtilization for faster autoscaling. The one provided by AWS with 1-min resolution is not good enough. While finding a solution on how to create one, I came across this blog post which shows using System Manager and unified Cloud Agent to create a scaling policy using Memory Utilization - BLOG.

I checked and found that there is no metric collected by the CloudWatch Agent under the name CPUUtilization but there is one under the name cpu_usage_active. So, I am confused as to whether both the metrics are same or different. If different, then how so?

Thanks

1 Answers
0

Amazon ECS supports CPU utilization metrics across multiple dimensions: cluster and service.

Cluster-wide average CPU utilization is calculated by adding the CPU resources consumed by all tasks running on EC2 instances in the cluster and dividing it by the total CPU resources among all EC2 instances registered with the cluster. For example, if your total EC2 capacity in your ECS cluster is 100 vCPUs, and your tasks are consuming a total of 50 vCPUs, then the average cluster-wide CPU utilization will be 0.5 (50%). This value should be similar to the average value reported by a collection of on-instance agents (such as the Amazon CloudWatch Agent) running on the same EC2 instances. Cluster CPU utilization is only applicable to EC2 instances; Fargate tasks will not be included in this calculation.

Service-wide average CPU utilization is calculated by adding the CPU utilization of all tasks running in the service and dividing it by the total CPU reservation of all tasks running in the service. For example, if you have 100 tasks running, each task has a reservation of 1024 CPU units (1 vCPU), and the tasks are currently consuming 40960 CPU units (40 vCPUs) in total, then the average CPU utilization will be 40%. The total vCPU capacity of the EC2 instances isn't considered for service-wide CPU utilization. And service-wide CPU utilization includes Fargate task utilization.

EXPERT
answered 3 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions