Can I set an additional target value that only applies to scale-in of aws ecs fargate?

0

I configured autoscaling using aws ecs fargate.

For example, if I set the target value of cpu to 80 among the service indicators, I know that if the cpu usage rate is over 80%, the number of tasks will be increased by scaling out, and if it is less than 80% in the increased state, it will be scaled in and the number of tasks will be reduced.

What I am concerned about is that in case of scale in, the cpu target value is 80, so if it is less than 80, the number of tasks will decrease. Therefore, after the task is executed, it will be scaled in immediately, and the number of tasks will immediately drop below 80. (In case there is no cooldown period)

I think you can prevent the number of tasks from decreasing right away by setting a scale-in cooldown period, but it would be more useful if you additionally set a service indicator target value that only scales in.

Is there a way to separately set the target value to which only scale in is applied in the ecs fargate service?

Or is there a way other than setting the cooldown period?

joker
asked a year ago262 views
1 Answer
0
Accepted Answer

Hi,

The scale-in value actually isn't the target value, if you pull up the CloudWatch alarms created by the target tracking policy, the Low usage alarm will be some amount under the target value (dynamically calculated by target tracking). Additionally, it requires 15 periods of 60 seconds each to be triggered, so at the very least its not scaling in for 15 minutes (alarm settings aren't configurable with target tracking)

Additionally, target tracking has quite a few built in mechanisms to prevent excessive churn of your service. If target tracking doesn't feel like its 'safe' to scale-in, it won't. For example, if you have multiple target tracking scaling policies, it will only scale-in if all of them want to at once (ex, one for CPU and one for Memory Reservation is a common setup in ECS)

Target Tracking works quite well for the majority of usecases, but if you try it out and its not working for you, you can click the 'disable scale-in' option on the policy and make a custom Step Scaling based policy and alarm where you set everything to your exact preferred values. Just keep in mind that step scaling does NOT have all the other internal protections target tracking has to prevent churn. If the policy triggers and isn't blocked by cooldown/in-progress activities, it'll scale - so be careful when configuring all the alarm and policy settings.

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