Auto scaling group: Terminate burstable instance with lowest CPU credit balance first

0

Hi,

How can we update our Elastic Beanstalk environment to terminate - during an automatic down-scaling event - the instance with the lowest amount of CPU credit balance?

Currently, when scaling down, it terminates the oldest instance, leaving new instances in place that may have only just started to accumulate CPU credits.

Thank you for any help in this regard.

질문됨 2년 전300회 조회
1개 답변
1

ASG's support setting a custom termination policy for changing which instances are selected for termination when a scale in event occurs https://docs.aws.amazon.com/autoscaling/ec2/userguide/ec2-auto-scaling-termination-policies.html#custom-termination-policy - Beanstalk does not provide a way to override this setting to OldestInstance or the most relevant policy. It only allows for a small subset of settings on the ASG to be adjusted https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/command-options-general.html#command-options-general-autoscalingasg.

lp901
답변함 2년 전
  • Is there a termination policy that considers the CPU credit balance?

  • Not one of the build in ones, you'd need to create a Lambda function and use a custom policy as lp901 mentioned. You could change to using the built in "NewestInstance" policy instead of making a custom one, but that isn't guaranteed to get rid of instances with the fewest credits

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

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

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