π‘οΈ 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 with categories
- π’ Policy with type
- π’ Production policy
- Policy Type:
COMPLIANCE_POLICY - Policy Categories:
COST,PERFORMANCE
Statsβ
not available
Logicβ
- π§ prod.logic.yamlπ’
Descriptionβ
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
INCOMPLIANTif 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
COMPLIANTif neither resource meets both thresholds.
Remediationβ
Remediationβ
Reduce Excess ECS Task Reservationsβ
- 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.
- 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
- 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β
- 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β
Linked Framework Sectionsβ
| Section | Sub Sections | Internal Rules | Policies | Flags | Compliance |
|---|---|---|---|---|---|
| πΌ Cloudaware Framework β πΌ Resource Right-Sizing | 26 | no data | |||
| πΌ Cloudaware Framework β πΌ Workload Efficiency | 31 | no data |