Idle ECS Container Instances Due to ASG Minimum Capacity
Akarsh Inuganti
Service Category
Compute
Cloud Provider
AWS
Service Name
AWS ECS
Inefficiency Type
Inefficient Configuration
Explanation

When ECS clusters are configured with an Auto Scaling Group that maintains a minimum number of EC2 instances (e.g., min = 1 or higher), the instances remain active even when there are no tasks scheduled. This leads to idle compute capacity and unnecessary EC2 charges.Instead, ECS Capacity Providers support target tracking scaling policies that can scale the ASG to zero when idle and automatically increase capacity when new tasks or services are scheduled. Failing to adopt this pattern results in persistent idle infrastructure and unnecessary costs in ECS environments that do not require always-on compute.

Relevant Billing Model
  • EC2 container instances in ECS are billed like regular EC2 instances — by the second, based on type and size
  • ASGs that maintain a minimum capacity > 0 will keep EC2 instances running even if no ECS services or tasks are scheduled
  • ECS Capacity Providers can scale ASGs dynamically using target tracking, enabling min = 0 when idle
Detection
  • Identify ECS clusters using EC2 launch type
  • Check the associated ASG for a minimum capacity > 0
  • Analyze task scheduling patterns to confirm periods of inactivity
  • Correlate EC2 uptime with lack of ECS service or task activity
Remediation
  • Configure an ECS Capacity Provider for the cluster and attach a target tracking scaling policy
  • Set the ASG minimum capacity to 0 to allow scale-down during idle periods
  • Ensure ECS services are configured with appropriate scaling triggers (e.g., CPU or memory utilization)
  • Monitor for unintended delays when new tasks are scheduled to validate scaling responsiveness