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

desired_capacity clashes with alarm-based scaling #63

Open

Description

@jsonmaur

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).

Activity

  1. lukebarton commented on Mar 17, 2017

    @lukebarton

    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 join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions