Why it matters
Task sizes are often set generously at first and never revisited. Every running task pays for the unused part, so the saving grows with the number of tasks.How nOps finds it
This recommendation comes from AWS Compute Optimizer, not from nOps. Compute Optimizer looks at the service’s CloudWatch CPU and memory metrics over its lookback period and recommends task CPU and memory that would still meet the workload’s needs. nOps imports the recommendation daily from AWS Cost Optimization Hub, which returns one recommendation per resource (the one with the highest saving), and shows AWS’s estimated monthly saving, which already takes your discounts into account.Before you start
AWS Compute Optimizer and AWS Cost Optimization Hub enabled for the account (or the whole organization). Permission to register task definitions and update services.How to implement
- Review the recommended CPU and memory, and any container-level limits inside the task definition.
- Register a new task definition revision with the recommended task size (it must be a valid Fargate CPU and memory combination).
- Update the service to the new revision (ECS console: Update service, or
aws ecs update-service --task-definition FAMILY:REVISION). ECS replaces tasks with a rolling deployment. - Watch CPU, memory and error rates, and check the service’s auto scaling targets.
- Update the task definition in Terraform, CloudFormation or your deployment pipeline.
Risks and considerations
- A task that runs out of memory is stopped by ECS, so leave headroom for peaks.
- Smaller tasks can trigger target-tracking scaling sooner, which adds tasks and lowers the saving.
- To roll back, update the service to the previous task definition revision.