testerboy
testerboy

Reputation: 79

AutoScaling of ECS Fargate Service of custom Metrics of SQS ApproximateNumberOfMessagesVisible and Cloudwatch Alarm

I have an ECS Fargate Service that processes messages from SQS queue and has a desired count of 1 task. I am trying to setup autoscaling for this ECS service. The way I want to setup this scaling is as follows: Scale Out

if ApproximateNumberOfMessagesVisible >= 5 -> scale to 4
if ApproximateNumberOfMessagesVisible >= 12 -> scale to 8
if ApproximateNumberOfMessagesVisible >= 20 -> scale to 12 (MaxCapacity)

Scale In

if ApproximateNumberOfMessagesVisible < 12 -> scale down to 8
if ApproximateNumberOfMessagesVisible < 5 -> scale to 1

I have setup the Scalable Target, cloudwatch Alarm. The problem I am facing is with scaling policy values For scale out

metricIntervalLowerBound: 1,
metricIntervalUpperBound: undefined,
scalingAdjustment: 1

For scale in

metricIntervalLowerBound: undefined,
metricIntervalUpperBound: 1,
scalingAdjustment: -1

The problem is I am getting this weird error

There must be a step adjustment with an unspecified upper bound when one step adjustment has a positive upper bound (Service: ApplicationAutoScaling

Can somebody please help with the scale out and scale in policies. The wordings in the docs are also very confusing. I am doing this in CDK. The larger goal of doing this to integrate with a system where number of messages can be > 500 to 1000.

Thanks

Upvotes: 1

Views: 46

Answers (0)

Related Questions