ECS auto scale-in doesn't work event though I got CloudWatch scale-in Alarm

0

Environment

  • ECS & Fargate
  • Scaling policy Enter image description here

And I got scale-in alarm like: Enter image description here

But, ECS doesn't scale-in since 18:43 Enter image description here

Enter image description here

I don't use scale-in protection option.

Please let me find the reason if you experienced similar problems.

1 Answer
1
Accepted Answer

Hello,

In general, AutoScaling might choose not to scale-in when an alarm goes off for quite a few reasons (already at the min, suspended processes, in progress activities, etc). And Target Tracking specifically has multiple additional layers of checks built in (ex, if there's multiple target tracking policies, they all need to want to scale-in at the same time). This is all done to prevent excessive oscillation and maintain high availability in the environment.

There was a recent Application AutoScaling feature launched to help add additional transparency to these not-scaling decisions. From the AWS CLI, can you run the below command (filling in your specific info where needed) and let me know if it has information to shed light on the delayed scaling?

aws application-autoscaling describe-scaling-activities \
    --include-not-scaled-activities \
    --service-namespace ecs \
    --scalable-dimension ecs:service:DesiredCount \
    --resource-id service/default/web-app

If you see an error in the CLI stating that --include-not-scaled-activities isn't a valid flag, you'll need to update the CLI (since this is a relatively recent feature). Alternatively, you could use CloudShell in the AWS Console which should have the latest CLI build

AWS
answered a year ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions