question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[ecs] Step Scaling policy does not create all steps

See original GitHub issue

I’m using the scaleOnMetric method of the FargateService construct. My requirements need 2 policies.

construct.scaling.scaleOnMetric('scale-up-policy', {
  scalingSteps: [
    {
      lower: 65,
      change: +2,
    },
    {
      lower: 85,
      change: +3,
    },
  ],
  metric: construct.service.metricCpuUtilization({
    statistic: 'Maximum',
    period: cdk.Duration.minutes(1),
  }),
  cooldown: cdk.Duration.minutes(2),
});

construct.scaling.scaleOnMetric('scale-down-policy', {
  scalingSteps: [
    {
      upper: 50,
      change: -1,
    },
    {
      upper: 40,
      change: -2,
    },
  ],
  metric: construct.service.metricCpuUtilization({
    statistic: 'Average',
  }),
});

However it never creates the 65 step. It only creates >85 step.

Screenshot 2020-09-02 at 3 35 05 PM

Reproduction Steps

  • Create a FargateService
  • Add autoscaling
  • Make step scaling policies as outlined above

What did you expect to happen?

I should have 2 alarms created with the actions:

  • low alarm

    • remove 1 task < 50% CPU
    • remove 2 tasks < 40 % CPU
  • high alarm

    • add 2 tasks > 65% CPU
    • add 3 tasks > 85% CPU

What actually happened?

Environment

  • CLI Version : 1.61.1
  • Framework Version: 1.61.1
  • Node.js Version: v14.8.0
  • OS : mac os
  • Language (Version): typescript

Other


This is 🐛 Bug Report

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:4
  • Comments:11 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
kyler-hyunacommented, Jul 8, 2021

Thanks for fixing this @ruancomelli 🎉

0reactions
github-actions[bot]commented, Jul 8, 2021

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see. If you need more assistance, please either tag a team member or open a new issue that references this one. If you wish to keep having a conversation with other community members under this issue feel free to do so.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Step scaling policies - Amazon Elastic Container Service
When you create a step scaling policy, you specify one or more step adjustments that automatically scale the number of instances dynamically based...
Read more >
AWS step scaling adding more tasks than configured
A couple of things. Its not going to trigger all 3 of the steps and add 6. It will pick a single step...
Read more >
Configuring AWS Auto Scaling | Crosswalk - Pulumi
AWS Auto Scaling can be used to build scaling plans for resources including Amazon EC2 instances and Spot Fleets, and Amazon ECS clusters...
Read more >
Configure Amazon ECS Service Auto Scaling on Fargate
Step Scaling Policy. For step scaling policies, we create and manage the CloudWatch alarms that trigger the scaling process. We can create ......
Read more >
Auto Scaling:Manage scaling rules - Alibaba Cloud
You can create simple scaling rules, step scaling rules, ... If you do not configure the Cooldown Time parameter of the scaling rule, ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found