Two controllers, two different capacities
How replica scaling and backing cluster scaling interact when capacity limits, startup delays, and scale-in timing constrain container workloads. · advanced
Container scaling on EC2 has two control loops. Replica scaling changes the desired number of tasks or Pods. Cluster scaling changes the compute capacity on which those replicas can run. Increasing the desired count does not create room for those replicas: the scheduler must still find suitable capacity.
On Amazon EKS, the Horizontal Pod Autoscaler (HPA) adjusts workload replicas from observed metrics. Cluster Autoscaler can expand configured node groups when unschedulable Pods would fit on additional nodes. On Amazon ECS, Service Auto Scaling uses Application Auto Scaling to adjust a service's desired task count. An EC2 Auto Scaling group capacity provider with managed scaling adjusts backing instance capacity for workloads assigned to it.
These loops coordinate through workload demand and placement constraints; they are not one atomic operation. Scaling the wrong layer leaves the bottleneck unchanged. With AWS Fargate, you do not manage the backing EC2 node-scaling loop, but task or Pod provisioning still has delays and capacity constraints.
| Environment | Replica control | Backing EC2 control |
|---|---|---|
| EKS | Horizontal Pod Autoscaler | Cluster Autoscaler |
| ECS on EC2 | Service Auto Scaling | Capacity provider managed scaling |