How do I resolve "the closest matching container-instance container-instance-id has insufficient CPU units available" error in Amazon ECS?

2 minuti di lettura
0

When I try to place a task in Amazon Elastic Container Service (Amazon ECS), I get the following error: "the closest matching container-instance container-instance-id has insufficient CPU units available."

Resolution

To meet the requirements of the task definition, you must adjust the CPU units of your closest matching container instance for task placement.

Check the remaining CPU units on your container instance

To check the remaining CPU units, you can use either Amazon ECS console, or the AWS Command Line Interface (AWS CLI).

Amazon ECS console

Complete the following steps:

  1. Open the Amazon ECS console.
  2. Choose the cluster where you want to place the task, and then choose the ECS Instances tab.
  3. Select the container instance with the ID that's in the error message.
  4. Review the table's CPU row that lists the Registered and Available number of CPU units.

AWS CLI

Run the describe the container instance command.

Note: If you receive errors when you run AWS CLI commands, then see Troubleshoot AWS CLI errors. Also, make sure that you're using the most recent AWS CLI version.

Make adjustments to meet the CPU requirements

To meet the CPU requirements, modify your task size, or specify the total CPU that's used for the task when you create your task definition.

Also, update the cpu container definition of your task definition. The number of cpu units that remain in the Amazon Elastic Compute Cloud (Amazon EC2) instance must at least equal the number at the container definition level. The number of CPU units in an EC2 instance vary by the instance type that's used in the cluster.

Finally, add more container instances to the cluster. Or, add a larger instance type to your container that provides more CPU units per instance for larger tasks.

Related information

Launching an Amazon ECS Linux container instance

Amazon ECS task definition parameters

How do I resolve the "[AWS service] was unable to place a task because no container instance met all of its requirements" error in Amazon ECS?

How do I resolve "the closest matching container-instance container-instance-id encountered error 'AGENT'" error for my service in Amazon ECS?

AWS UFFICIALE
AWS UFFICIALEAggiornata 7 mesi fa