1

I have configured a CloudWatch alarm in order to trigger auto scaling for an ECS service. The alarm is configured to trigger auto scaling when there's a certain number of scheduled activities in a step function.

But when testing with 1000+ scheduled activities in the step function, the alarm is raised, but the number of scheduled activities showed in CloudWatch metrics is much lower than the number scheduled activities I see in the step function itself. Therefore either no scale up occurs, or a much lower number of machines is

This is the alarm configuration:

{
    "Type": "AWS::CloudWatch::Alarm",
    "Properties": {
        "AlarmName": "thumbnails-generator-scaling-alarm",
        "ActionsEnabled": true,
        "OKActions": [],
        "AlarmActions": [
            "arn:aws:autoscaling:us-west-2:111111111111:scalingPolicy:8694a867-85ee-4740-ba70-7b439c3e5fb3:resource/ecs/service/prod/thumbnails-generator:policyName/thumbnails-generator-scaling-policy"
        ],
        "InsufficientDataActions": [],
        "MetricName": "ActivitiesScheduled",
        "Namespace": "AWS/States",
        "Statistic": "SampleCount",
        "Dimensions": [
            {
                "Name": "ActivityArn",
                "Value": "arn:aws:states:us-west-2:111111111111:activity:thumbnails-generator-activity-prod"
            }
        ],
        "Period": 300,
        "EvaluationPeriods": 1,
        "DatapointsToAlarm": 1,
        "Threshold": 0,
        "ComparisonOperator": "GreaterThanOrEqualToThreshold",
        "TreatMissingData": "missing"
    }
}

This is the auto scale configuration:

auto scale configuration

Please advise what can I do in order to make the auto scale work properly.

David Faizulaev
  • 4,651
  • 21
  • 74
  • 124

1 Answers1

0

I guess you need to use Sum instead of SampleCount statistic.

SampleCount is the number of data points during the period.

Jan Garaj
  • 25,598
  • 3
  • 38
  • 59