0

I have an Amazon EC2 Auto Scaling group, health check is 5 minutes to mark the instance healthy and default cooldown is 4 minutes. I have a scaling policy that will check if the CPU usage is at 70% for n datapoints for 1 min and add n of instances.

Will I have an issue? Does the scaling policy add to the default cooldown timing? My understanding is I will have an issue due to my default cooldown being less than my health check time.

Scenario: When new instances are launched and the health check hasn't passed yet (5 minutes) and another scaling happens (4 minutes). Is this an issue or valid statement?

Thanks in advance.

John Rotenstein
  • 241,921
  • 22
  • 380
  • 470
mr1110
  • 45
  • 1
  • 5
  • It depends on scaling policy. So what scaling policy do you use? For example, target scaling policy can launch new instances without waiting for the cooldown to finish. – Marcin Jul 07 '20 at 23:53
  • I have a 2 simple scaling policy. CPUUtilization < 25 for 10 consecutive periods of 60 seconds Remove 2 instance Wait : 120 seconds before allowing another scaling activity and CPUUtilization > 70 for 60 seconds Add 3 instance Wait : 240 seconds before allowing another scaling activity – mr1110 Jul 08 '20 at 00:23

1 Answers1

0

You probably don't want to be adding so many instances at once. Rather than removing 2 and adding 3, try configuring the scaling policies to add/remove one instance at a time.

The Health Check is used to identify unhealthy instances and remove/replace them in the Auto Scaling group.

The Cooldown is used to avoid adding/removing instances before the metric settles into a regular pattern. For example, an instance might take a while before it starts accepting requests, which could impact the metric you are using for scaling.

You shouldn't really need to worry about how they interact with each other, but make sure the health check has enough time for the instance to start responding to queries.

John Rotenstein
  • 241,921
  • 22
  • 380
  • 470
  • Thank you, @John. Follow up question, with regards to your last point. There are many cases that the new instances are getting at 90% cpu utilization upon passing the health check and being marked as healthy instance, is this an application issue? This is my dilemma on cooldown and health check, which i asked above. Thanks again. – mr1110 Jul 08 '20 at 03:17
  • 1
    The CPU Utilization metric is calculated as an Average across _all_ Amazon EC2 instances in the Auto Scaling group. While some instances might be 'busy', the metric relates to how busy _all instances_ are _on average_. The Health Check is unrelated to the scaling metric -- it just checks that the instance responds to requests. – John Rotenstein Jul 08 '20 at 03:41