![]() ![]() ![]() dimensions Name=ClusterName,Value=your-cluster Name=ServiceName,Value=your-service-name -unit Percent \ comparison-operator GreaterThanOrEqualToThreshold -evaluation-periods 1 -datapoints-to-alarm 1 \ namespace AWS/ECS -statistic Average -period 60 -threshold 60 \ alarm-name Test-ScaleOut -metric-name MemoryUtilization \ Associate your scaling policy from step 1 as an alarm action to your new or existing CloudWatch alarm: aws cloudwatch put-metric-alarm \ target-tracking-scaling-policy-configuration ''Ģ. policy-name Test-target-tracking-scaling-policy -policy-type TargetTrackingScaling \ Create a target tracking or step scaling policy for the scalable target (that is, your Fargate service).Ĭreate a target tracking policy: aws application-autoscaling put-scaling-policy \ min-capacity 1 -max-capacity 10 -region us-east-1Ģ. resource-id service/your-cluster/your-service-name \ service-namespace ecs -scalable-dimension ecs:service:DesiredCount \ Register your Fargate service as a scalable target with Application Auto Scaling: aws application-autoscaling register-scalable-target \ Configure Service Auto Scaling using the AWS CLIġ. Note: For more information, see Step 5: Configuring your service to use Service Auto Scaling. You can increase or decrease your desired task count by creating scaling policies to handle scale-in and scale-out activity.You can specify the scaling adjustment type as a percentage of the current capacity of your scalable target, or by using absolute numbers.You must choose scaling actions or step adjustments, such as ScalingAdjustment, MetricIntervalUpperBound, and MetricIntervalLowerBound.You can create or use existing CloudWatch alarms for any metric for step scaling.You must choose a scale-out and scale-in cooldown period.This is because a target tracking policy adds or removes capacity as required to keep the metric at, or close to, the specified target value. ![]() You don't need to configure the scaling action like you do with a step scaling policy. A target tracking policy calculates the scaling adjustment (that is, desired task count) based on the metric and target value that you define.You can use the ECSServiceAverageCPUUtilization, ECSServiceAverageMemoryUtilization, and ALBRequestCountPerTarget Amazon ECS service metrics for target tracking.Application Auto Scaling creates and manages the CloudWatch alarms that trigger the scaling policy. You must define a target value (threshold) for your specified metric.Choose a scaling policyĬhoose either a target tracking policy or step scaling policy based on your requirements and the following considerations: Complete the remaining steps in the setup wizard to create or update your service. In the Automatic task scaling policies section, choose Auto Scaling Policy.ħ. For IAM role for Service Auto Scaling, choose ecsAutoscaleRole.Ħ. Note: The minimum and maximum number of tasks are hard limits for your service.ĥ. For Maximum number of tasks, enter the highest number of tasks that you want Service Auto Scaling to use. Note: The desired number of tasks must be in the range of your minimum and maximum task count.Ĥ. For Desired number of tasks, enter the number of tasks that you want Service Auto Scaling to use. For Minimum number of tasks, enter the lowest number of tasks that you want Service Auto Scaling to use.ģ. Choose Configure Service Auto Scaling to adjust your service’s desired count.Ģ. When you create or update a service in the Amazon ECS console, choose the following from the Set Auto Scaling page:ġ. Configure Service Auto Scaling for your Fargate service For more information, see IAM permissions required for service auto scaling. Note: The IAM user that accesses Service Auto Scaling settings must have the appropriate permissions for the services that support dynamic scaling. Note: If you receive errors when running AWS Command Line Interface (AWS CLI) commands, make sure that you’re using the most recent AWS CLI version. Your scaling activity remains in the InProgress state until the desired count and the running count are same. The Amazon ECS service scheduler launches or shuts down tasks to meet the new desired count. Then, Application Auto Scaling makes the UpdateService API call to Amazon ECS with the new desired count value. When your CloudWatch alarms trigger an Auto Scaling policy, Application Auto Scaling decides the new desired count based on the configured scaling policy. Then, you can use CloudWatch metrics to configure your CloudWatch alarms. You can increase or decrease your desired task count by integrating Amazon ECS on Fargate with Amazon CloudWatch alarms and Application Auto Scaling. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |