Tushar Vaswani
Tushar Vaswani

Reputation: 11

EC2 Autoscaling group launching more instances than required

I have setup an ecs cluster with ec2 autoscaling group as capacity provider. When I deploy one service to my cluster. It launches 2 ec2 tasks(or service as there is just one task in service). And then later on kill one of the instance by scaling down. If I launch 2 tasks then it scales to 4 instances and then after that scales down after some time. Now the most problematic thing here is that this stuff is happening continously and I am being charged continously. And if termination protection is off it's sometimes deleting instances which were in use and so they get deployed again which again triggers to launch 4 instances making this run even in an infinite loop. This would become pretty expensive for me if its not stopped at this point. I am clearly able to see that there are just 2 instances in use but still 2 more are there for no reason. Some information that might be needed -

  1. Capacity provider target capacity is set to 100% and so I was expecting it to not scale extra and reserve more amount for future use ->

enter image description here

  1. And that capacity provider is being used as default capacity provider strategy ->

enter image description here

  1. My autoscaling group settings ->

enter image description here

Would be great if anyone can help me fix this. Thanks

Upvotes: 1

Views: 166

Answers (0)

Related Questions