I want to know why my CPU utilization is high on my Amazon Elastic Container Service (Amazon ECS) tasks on AWS Fargate.
Resolution
Troubleshoot high CPU utilization for Fargate tasks in an ECS service
To view the service-level CPU utilization for your tasks, check your Amazon ECS metrics. If you use the Fargate launch type, then view the CPUUtilization metric for your service in Amazon CloudWatch. For more information, see View available metrics.
Then, check for an ongoing deployment in your Amazon ECS service. If you find an ongoing deployment in your service, then wait for Amazon ECS to complete the deployment.
If there isn't an ongoing deployment, then check your application logs for tasks that perform CPU-intensive operations. CPU-intensive operations vary based on the application that's deployed in your Fargate task.
Note: Your logging driver determines which destinations receives your logs. The awslogs driver exports your logs to CloudWatch.
In the CloudWatch metrics for your Application Load Balancer, review the RequestCount metric to monitor increases in incoming traffic to your Amazon ECS service. If the request volume for your tasks increases, then use Application Auto Scaling to increase the number of tasks that must run in the service.
Troubleshoot high CPU utilization for standalone Fargate tasks
To view task-level metrics through performance logs, activate Container Insights on Amazon ECS.
If your application's containers must perform CPU-intensive workloads, then choose a task size for your task definition that includes higher CPU and memory values. Make sure to choose a valid CPU and memory combination. For a list of For valid CPU and memory combinations, see the table in Step 7 of Procedure.
Related information
AWS Fargate Pricing