π‘οΈ AWS ECS Service is underutilizedπ’
- Contextual name: π‘οΈ Service is underutilizedπ’
- ID:
/ce/ca/aws/ecs/service-underutilized - Tags:
- π’ Policy with categories
- π’ Policy with type
- π’ Production policy
- Policy Type:
COMPLIANCE_POLICY - Policy Categories:
COST,PERFORMANCE
Statsβ
not available
Logicβ
- π§ prod.logic.yamlπ’
- π AWS ECS Service
- π AWS ECS Service - object.extracts.yaml
- π§ͺ test-data.json
Descriptionβ
Descriptionβ
Identify running Amazon ECS services whose CPU and memory use are low compared with their task allocations over a 14-day window. Review whether smaller tasks or fewer replicas can meet the workload's needs.
Rationaleβ
ECS measures service CPU and memory use relative to configured task resources. Reducing a Fargate task size or replica count can reduce billable capacity. On EC2, a change can free task reservations for placement, and direct compute savings depend on a later reduction of the backing fleet.
Auditβ
This policy marks an AWS ECS Service as
INCOMPLIANTif CloudWatch: CPU Utilization, 14-Day and CloudWatch: Memory Utilization, 14-Day are both below 40%, and at least one is 1% or higher. Services with both averages below 1% are markedINAPPLICABLE. An eligible service isCOMPLIANTif either average is 40% or higher.The policy evaluates ACTIVE services with REPLICA scheduling that were created at least 14 UTC calendar days ago. Running Count must be positive and match Desired Count, and Pending Count must be zero. Assessment requires both 14-day averages. Confirm recent metric coverage and peak demand before resizing.
Remediationβ
Remediationβ
Right-Size the ECS Serviceβ
Review CPU and memory utilization, running task counts, and recent deployments in CloudWatch and Amazon ECS. Check peak demand, metric coverage, and latency over a representative workload cycle. Choose smaller tasks when individual tasks have headroom, or fewer replicas when the service can meet its availability and throughput requirements with a lower task count.
Record the current task definition ARN, desired count, and Service Auto Scaling settings before making changes. Test the proposed capacity under representative load. For services managed through infrastructure as code, apply the change through the existing deployment process.
Using the AWS CLIβ
Reduce the Task Sizeβ
- Prepare a task definition registration file with the lower CPU or memory allocation. Preserve unrelated settings and confirm that container reservations and limits fit the new task size. For Fargate, choose a supported CPU and memory combination. Supported Fargate task sizes
... 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 |