I am testing ecs fargate auto scaling. I have set the threshold to 60% for scale out. I increased the load above 60% and scale out is working fine. But during scale in it is not reducing the task even if cpu utilization is 50%. Alarm low threshold is 54%. It only starts to scale in when cpu utilization reaches 0 and 15 datapoints are 0. I tried increasing the low alarm threshold to 70% so the gap between cpu utilization and alarm threshold increases but still it starts to scale in after cpu utilization reaches 0 only. Min and max tasks values are 1 and 3 respectively in auto scaling policy. Desired tasks is 1.
Can someone please help why it is happening
Thanks.
Why scalein triggering too late and only when cpu utilization reaches 0. Any metrics I need to modify how I can test the scale in for ecs fargate
I am testing ecs fargate auto scaling. I have set the threshold to 60% for scale out. I increased the load above 60% and scale out is working fine. But during scale in it is not reducing the task even if cpu utilization is 50%. Alarm low threshold is 54%. It only starts to scale in when cpu utilization reaches 0 and 15 datapoints are 0. I tried increasing the low alarm threshold to 70% so the gap between cpu utilization and alarm threshold increases but still it starts to scale in after cpu utilization reaches 0 only. Min and max tasks values are 1 and 3 respectively in auto scaling policy. Desired tasks is 1.
Can someone please help why it is happening
Thanks.
Why scalein triggering too late and only when cpu utilization reaches 0. Any metrics I need to modify how I can test the scale in for ecs fargate
Share Improve this question asked Mar 25 at 10:52 SuryanshSuryansh 112 bronze badges1 Answer
Reset to default 2Hmm, there might be couple of reasons, If after checking that your metrics are set properly, It could be the cooldown period after a scale-out event before scale-in can occur. Check your scaling policy's cooldown settings. And also, it could be that the fluctuation between scaling states is rapid and this is will lead to Thrasing. You can try reducing the datapoints maybe 3 instead of 15 and then test with controlled load, gradually reduce the load to below the scale-in threshold (e.g., 50%) and observe CloudWatch metrics/alarms. Use the AWS CLI to check alarm states: aws cloudwatch describe-alarms --alarm-names <scale-in-alarm-name>