-1

I was looking for some input about AWS auto-scaling. I'm running into an issue where AWS is scaling out twice in a row even though there's only a pretty small traffic increase.

I've got an alarm set up to add 2 tasks when my RequestCountPerTarget exceeds a threshold. These should more than cover the increased traffic. The interval on the alarm is for 3 datapoints (so within 3 minutes).

However it seems to take about 5 minutes for AWS to add the tasks. I suspect this is the problem - can it fire the alarm again, while the 2 tasks are still being added / registered? (before it's reached a "steady state")

And if so, is there any better alternative to increasing the 3-minute interval? (I'm concerned we won't react as quickly to traffic spikes.)

Appreciate any input!

Andrei
  • 513
  • 2
  • 8
  • 15
  • You can increase the [cooldown time](https://docs.aws.amazon.com/autoscaling/application/userguide/application-auto-scaling-target-tracking.html#target-tracking-cooldown). – Marcin Sep 25 '20 at 00:40

1 Answers1

1

Since you mentioned ECS tasks, I'm assuming you meant Application AutoScaling (AWS AutoScaling is a different service). For AutoScaling, any time an alarm is in the Alarm state, it sends a notification to AutoScaling every minute, and then AutoScaling checks if it can scale based on the scaling policy settings. So:

  1. ELB services pushes metrics to cloudwatch
  2. Every minute the alarm will look at the past however many minuets/periods you've configured and decide if it should go into alarm https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/AlarmThatSendsEmail.html
  3. After the alarm goes into the Alarm state, it notifies AutoScaling every minute while it stays in the Alarm state (no mater what the alarm settings are, since the alarm gets evaluated every minute)

To make sure over scaling doesn't happen, you need to set the cooldown on the scaling policy. The scaling policy won't increase the desired capacity again unless either:

A) A larger scale out is triggered (based on the current alarm values)

B) The cooldown ends

Shahad
  • 771
  • 4
  • 6