ECS Fargate Task STOPPED with error code TaskFailedToStart: RESOURCE:MEMORY

0

ECS Fargate Task STOPPED after provisioning state with error code TaskFailedToStart: RESOURCE:MEMORY even 977MB memory and 1024 CPU.

Could you please guide me where configuration is wrong?

Naresh
已提问 1 年前1309 查看次数
3 回答
0

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

profile picture
专家
已回答 1 年前
0

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.

hash
已回答 1 年前
0

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!

profile picture
已回答 1 年前

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则