Skip to content
This repository has been archived by the owner on Jul 3, 2023. It is now read-only.

desired_capacity clashes with alarm-based scaling #63

Open
jsonmaur opened this issue Nov 12, 2016 · 1 comment
Open

desired_capacity clashes with alarm-based scaling #63

jsonmaur opened this issue Nov 12, 2016 · 1 comment

Comments

@jsonmaur
Copy link

jsonmaur commented Nov 12, 2016

This is in reference to the ecs-cluster module.

I may be wrong on this (please correct me if I am), but doesn't setting desired_capacity on your autoscaling group conflict with the alarm-based scaling? If your asg is scaling up because of high cpu/memory reservation and you run terraform apply at the same time, it will knock your instance count back down to the number specified in your code (alarm-based scaling modifies the group's desired capacity). See this thread for reference.

desired_capacity is an optional argument for aws_autoscaling_group, so maybe it would be better to take it out (or at least not set a default).

@lukebarton
Copy link

lukebarton commented Mar 17, 2017

At the risk of adding a +1 post, I too am interested in this.

From my understanding, the ASG will scale based on the CPU alert. However from my observations I think there are two issues:

  • The Services themselves are limited to their predefined desired_count, meaning Services won't scale with the ASG - new instances will just be empty? Even if the ECS redistributes, this could quite easily lead to a situation where the ASG is constantly scaling up to the ecs_max_size due to "ServiceA" constantly maxing out the CPU because it's not actually scaling the service across newly available instances.
  • Secondly, whenever terraform is applied, the ASG will be downscaled to the desired_capacity?

I'm concerned about both issues.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants