Reputation: 35
First of all, what I'm trying to achieve is scale-out/scale-in during deployment with aws update-service
so that instance would not require double the memory of service (which is quite demanding memory-wise) at all times.
I do not provide Capacity Provider Strategy in update-service
because cluster has a default Capacity Provider Strategy set.
Everything, including ASG, cluster, ECS services, Capacity Provider and Capacity Provider Strategy is Terraformized. 1 ASG desired capacity set in Terraform and max capacity is 2.
My issue is that currently I have 2 instances in ASG (set to 2 desired instances by Capacity Provider), both being vastay underutilized. Yet CapacityProviderReservation
metric in the CloudWatch is reported as 135, meaning that it would scale-out if max desired capacity was not 2. And I'd actually expect a scale-in to happen, because all 4 services that are now spread accross 2 instances could fit into 1.
Why is it not scaling-in? Are my expectations on how Capacity Providers work incorrect? Or maybe there are other ways to achieve what I'm trying to achieve?
Upvotes: 1
Views: 59
Reputation: 781
Is the Capacity Provider target set to something lower than 100? If so, you're telling it you want extra instances as buffer for tasks and it'll try and launch extra ones.
Upvotes: 0