- Newest
- Most votes
- Most comments
Do you have ECS Exec enabled?
I have seen similar events in the past in my environment when ECS Exec is enabled.
If you have enabled it, try disabling it once.
https://docs.aws.amazon.com/AmazonECS/latest/userguide/ecs-exec.html#ecs-exec-considerations
Also, check the container image as it may be large.
https://repost.aws/knowledge-center/ecs-tasks-stuck-pending-state
Follow the steps to troubleshoot the issue.
-
Check the memory limit for your Fargate task definition: Make sure that the memory limit specified in your Fargate task definition is sufficient for your application to run. You can check this by going to your ECS console, selecting your task definition, and looking at the "Task memory" value in the "Task size" section. If necessary, increase the memory limit.
-
Check the memory usage of your application: If your task definition specifies a sufficient amount of memory, but your task is still running out of memory, you may need to investigate the memory usage of your application. Check the logs or performance metrics of your application to see if there are any memory leaks or other issues that are causing excessive memory usage.
-
Check the Fargate task size: The amount of memory and CPU you allocate to your task must be sufficient to run your application. Ensure that you have allocated enough resources to the task to run the application.
-
Check the resource utilization of other tasks: If other tasks are running on the same Fargate instance, they may be using up memory resources and causing your task to fail. Ensure that you have sufficient memory resources available on the Fargate instance to run your task.
-
Check for any misconfiguration in the task definition or the container image that can cause the task to fail to start.
Hi Naresh,
If your tasks runs on AWS Fargate, memory field is required, And You must use one of the following values. The value you choose determines your range of valid values for the cpu parameter.
512 (0.5 GB), 1024 (1 GB), 2048 (2 GB) - Available cpu values: 256 (.25 vCPU)
1024 (1 GB), 2048 (2 GB), 3072 (3 GB), 4096 (4 GB) - Available cpu values: 512 (.5 vCPU)
2048 (2 GB), 3072 (3 GB), 4096 (4 GB), 5120 (5 GB), 6144 (6 GB), 7168 (7 GB), 8192 (8 GB) - Available cpu values: 1024 (1 vCPU)
Between 4096 (4 GB) and 16384 (16 GB) in increments of 1024 (1 GB) - Available cpu values: 2048 (2 vCPU)
Between 8192 (8 GB) and 30720 (30 GB) in increments of 1024 (1 GB) - Available cpu values: 4096 (4 vCPU)
Between 16 GB and 60 GB in 4 GB increments - Available cpu values: 8192 (8 vCPU)
This option requires Linux platform 1.4.0 or later.
Between 32GB and 120 GB in 8 GB increments - Available cpu values: 16384 (16 vCPU)
This option requires Linux platform 1.4.0 or later.
So, in your case, you are using 1024, available combinations of memory are:
2048 (2 GB), 3072 (3 GB), 4096 (4 GB), 5120 (5 GB), 6144 (6 GB), 7168 (7 GB), 8192 (8 GB)
To know more about it: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecs-taskdefinition.html#cfn-ecs-taskdefinition-memory
Hope it helps!
Relevant content
- asked a year ago
- AWS OFFICIALUpdated 2 months ago
- AWS OFFICIALUpdated 3 months ago
- AWS OFFICIALUpdated a month ago
- AWS OFFICIALUpdated 4 months ago