- Newest
- Most votes
- Most comments
Yes, this is expected behavior when using an auto scaling group (ASG) with an ECS cluster.
The ECS auto scaling is responsible for scaling the tasks/containers based on metrics like CPU and memory utilization. However, it does not automatically launch new EC2 instances in the ASG.
The ASG is responsible for launching and terminating EC2 instances to maintain the desired capacity. But it does not know about ECS task placement requirements.
So when ECS wants to place more tasks, it first needs the ASG to launch new instances to add capacity to the cluster. The ASG won't do this on its own until its own scaling metrics (CPU, network etc.) trigger.
To solve this:
-
Configure ASG scale-out policies based on ECS metrics like pending tasks. This will trigger instance launches when ECS needs more capacity.
-
Use EC2 autoscaling directly instead of an ASG. ECS can then launch instances on its own when it needs more capacity.
-
Pre-warm your ASG to have spare capacity for ECS to scale out without waiting for new instances.
So in summary, the current behavior is expected due to the separation between ECS (scales tasks) and ASG (scales instances). You need to align their scaling metrics for a smoother experience.
Relevant content
- asked 3 years ago
- asked 3 years ago
- AWS OFFICIALUpdated 7 months ago
- AWS OFFICIALUpdated 2 months ago
- AWS OFFICIALUpdated 2 months ago