EC2 Autoscaling group launching more instances than required

0

Hey everyone,

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 as its launching instances more than required I am charged for minimum of one hour for each instance it launches. And this stuff is happening 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% -> Enter image description here
  2. And that capacity provider is being used as default capacity provider strategy -> Enter image description here

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

답변 없음

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠