13

It's unclear to me exactly how the underlying AWS Fargate cluster works under the covers.

Does the underlying cluster still scale up and down as needed when the tasks need more instances, and if so, where is that specified?

Anthony Neace
  • 25,013
  • 7
  • 114
  • 129
Steve
  • 53,375
  • 33
  • 96
  • 141
  • I don't think you'd find documentation regarding that. The whole point is that you don't have to worry about it. It's like Lambda where you just get the resources you use and you don't have to worry where they come from. – kichik Dec 04 '17 at 18:00
  • 1
    @kichik that's not true. With Fargate, you still need to take care of scaling for number of containers. Fargate takes care of scaling/managing the cluster. "AWS Fargate makes it easy to scale your applications." – David Lin May 16 '18 at 05:53

1 Answers1

10

Yes, Application Autoscaling works fine with Fargate.

Using CloudFormation:

  • create an AWS::ApplicationAutoScaling::ScalableTarget and specify for RescoureId your service/<cluster-name>/<service-name>
  • create your AWS::ApplicationAutoScaling::ScalingPolicy and specify only the ScalingTargetId (do not declare ScalableDimension, ServiceNamespace and RescoureId)

Add it will scale in/out your ECS service

Tommaso
  • 520
  • 1
  • 6
  • 20
  • Is this correct? As in, are you attempting to answer a different question from what the OP asked? AFAIK, Fargate does not need to be bothered with any configuration related to "how to scale". – talonx Apr 06 '18 at 12:01
  • 1
    yes, Fargate hides the EC2 instances; regarding the autoscaling you have to configure it using the Appliccation autoscaling. Fargate will automagiccally provide more host accordingly to the number of contsiners set by you, or by tge autlolscaling configuratilon – Tommaso Apr 07 '18 at 17:36
  • what about autoscaling up/down fargate tasks in a service with sqs depth ? – Zangetsu Apr 30 '18 at 18:25
  • @Zangetsu you can use any metrics/alarm to trigger an autoscaling event – Tommaso Apr 30 '18 at 19:43
  • 1
    Does fargate allow your cluster to scale down to 0 machines if no requests are coming in? – chrismarx Nov 02 '18 at 13:29
  • 1
    @chrismarx as far as the `AWS::ApplicationAutoScaling::ScalableTarget` has `MinCapacity` set at 0, it will scale down to 0 – Ing. Luca Stucchi Feb 26 '19 at 09:00