Skip to main content

πŸ›‘οΈ AWS ECS Cluster has high EC2 reservation relative to usage🟒

  • Contextual name: πŸ›‘οΈ Cluster has high EC2 reservation relative to usage🟒
  • ID: /ce/ca/aws/ecs/cluster-high-reservation-low-utilization
  • Tags:
  • Policy Type: COMPLIANCE_POLICY
  • Policy Categories: COST, PERFORMANCE

Stats​

not available

Logic​

Description​

Open File

Description​

Identify Amazon ECS on EC2 clusters where running tasks reserve much more CPU or memory than they use over the same 14-day reporting window.

Rationale​

Excess reservation can prevent ECS from placing new tasks and can trigger EC2 scale-out. This finding concerns task allocations. Reducing a reservation frees placement capacity, and direct savings depend on whether the freed capacity supports a later reduction in the EC2 fleet.

Audit​

This policy marks an AWS ECS Cluster as INCOMPLIANT if either of the following conditions holds.

  • CloudWatch: CPU Reservation, 14-Day is at least 80% and CloudWatch: CPU Utilization, 14-Day is below 40%.
  • CloudWatch: Memory Reservation, 14-Day is at least 80% and CloudWatch: Memory Utilization, 14-Day is below 40%.

The policy evaluates ACTIVE clusters with positive Running Tasks Count and Registered Container Instances Count, and at least one active container instance with a connected agent and linked running EC2 instance. Assessment requires all four 14-day averages. An eligible cluster is COMPLIANT if neither resource meets both thresholds.

Remediation​

Open File

Remediation​

Reduce Excess ECS Task Reservations​

  1. In CloudWatch, compare CPU reservation with CPU utilization or memory reservation with memory utilization over the same periods. Confirm the gap across a representative workload cycle and check peak demand, CPU throttling, and memory-related task stops.
  2. Review the running EC2-backed tasks and the task definitions that drive their reservations. For memory, check container soft reservations and hard limits. Include sidecars, task placement constraints, and deployment headroom when deciding what to reduce. Amazon ECS cluster reservation metrics
  3. Record the current task definition ARN and test the proposed change under representative load. Preserve the CPU or memory allocations needed at peak demand. For workloads managed through infrastructure as code, apply the change through the existing deployment process.
Using the AWS CLI​
  1. Prepare a task definition registration file with the lower allocation for the resource identified by the finding. Preserve unrelated settings and confirm that the revised task allocation accommodates its containers.

... see more

policy.yaml​

Open File

Linked Framework Sections​

SectionSub SectionsInternal RulesPoliciesFlagsCompliance
πŸ’Ό Cloudaware Framework β†’ πŸ’Ό Resource Right-Sizing26no data
πŸ’Ό Cloudaware Framework β†’ πŸ’Ό Workload Efficiency31no data