lserp / aws-kb

Q&A on AWS
MIT License
2 stars 0 forks source link

How does AutoScaling decide which instance to kill in a scale-in event? #11

Open lserp opened 7 years ago

lserp commented 7 years ago

Ref: http://docs.aws.amazon.com/autoscaling/latest/userguide/as-instance-termination.html Default behavior:

  1. Selects the AZ with most instances
  2. looks at the instance with the oldest launch configuration and kills it
  3. if multiple instances are using the same LC, kills the one closest to the next billing hour
  4. if multiple instances are close to the next billing hour, kills one at random

You can customize the scale-in policy (Ref: http://docs.aws.amazon.com/autoscaling/latest/userguide/as-instance-termination.html#custom-termination-policy)