Bobcares Logo
Search Call 1-800-383-5193 Emergency Contact
Bobcares Logo
Search Call 1-800-383-5193 Emergency Contact
Emergency Contact

Configure Amazon ECS Service Auto Scaling on Fargate

by Jiji Jose | Aug 22, 2021 | Amazon Web Services (AWS), Latest | 0 comments

Looking for how to configure Amazon ECS Service Auto Scaling on Fargate? We can help you with this!

As a part of our AWS Support Services, we often receive similar requests from our AWS customers.

Today, let’s see the steps followed by our Support Techs to help our customers to configure Amazon ECS Service Auto Scaling on Fargate.

 

 Service Auto Scaling

 
The Service auto-scaling is a combination of the Amazon ECS, CloudWatch, and Application Auto Scaling. It is the ability to increase or decrease the desired count of tasks in our ECS service automatically. Further, we can use CloudWatch metrics to configure the CloudWatch alarms. If the CloudWatch alarms trigger an Auto Scaling policy, then according to the scaling policy the Application Auto Scaling sets the new desired count.

Then, Application Auto Scaling makes the UpdateService API call to Amazon ECS with the new desired count value. The ECS service scheduler launches or shuts down tasks to meet the new desired count. Until the desired count and the running count becomes the same, the scaling activity remains in the InProgress state.
 

Configure Amazon ECS Service Auto Scaling on Fargate

 
Now let’s see the steps to configure Amazon ECS Service Auto Scaling on Fargate:

While creating or updating service in the Amazon ECS console, select the following from the Set Auto Scaling page.

  1. Select Configure Service Auto Scaling to adjust your service’s desired count.

2. Then enter the lowest number of tasks that we wish the Service Auto Scaling to use for the option Minimum number of tasks.

3. Enter the number of tasks that we wish the Service Auto Scaling to use for the option Desired number of tasks.

4. Also enter the highest number of tasks that we wish the Service Auto Scaling to use for the option Maximum number of tasks.

5. Then select ecsAutoscaleRole for the option IAM role for Service Auto Scaling. If this role is not available then select Create new role.

6. Select Auto Scaling Policy in the Automatic task scaling policies section and then proceed with the remaining steps for creating or updating the service.
 

Selecting scaling policy

 
There are two scaling policies and they are target tracking policy and step scaling policy. Based on our requirements we can select any of the policies.
 

Step Scaling Policy

 
For step scaling policies, we create and manage the CloudWatch alarms that trigger the scaling process.

  • We can create or use existing CloudWatch alarms for any metric for step scaling.
  •  

  • We must select scaling actions or step adjustments, like ScalingAdjustment and MetricIntervalUpperBound.
  •  

  • Also, we have to specify the scaling adjustment type as a percentage of the current capacity of the scalable target.
  •  

  • To handle scale-in and scale-out activity, we can increase or decrease the desired task count by creating scaling policies.

 

Target tracking Policy

 

  • We need to set a target value for the specified selected scaling metric. Auto Scaling creates and manages the CloudWatch alarms that trigger the scaling policy and calculates the scaling adjustment according to the metric and the target value.
  •  

  • For target tracking, we can use the ECSServiceAverageCPUUtilization, ECSServiceAverageMemoryUtilization, and ALBRequestCountPerTarget Amazon ECS service metrics.
  •  

  • Also, we must select a scale-out and scale-in cooldown period.

 

Configuration of Service Auto Scaling using the AWS CLI

 
Now let’s see the steps to configure service Auto Scaling using the AWS CLI:

  1. Firstly, we need to register the Fargate service as a scalable target with Application Auto Scaling:
aws application-autoscaling register-scalable-target \
--service-namespace ecs --scalable-dimension ecs:service:DesiredCount \
--resource-id service/your-cluster/your-service-name \
--min-capacity 1 --max-capacity 10 --region us-west-1

2. Then for the scalable target, create a target tracking or step scaling policy:

For Step scaling policy:

  1. At first, create a step scaling policy. For example:
aws application-autoscaling put-scaling-policy \
--service-namespace ecs --scalable-dimension ecs:service:DesiredCount \
--resource-id service/your-cluster/your-service-name \
--policy-name Test-Step-scaling-policy-ScaleOut --policy-type StepScaling \
--step-scaling-policy-configuration '{"AdjustmentType": "ExactCapacity","StepAdjustments": [ { "MetricIntervalLowerBound": 20, "ScalingAdjustment": 10}, { "MetricIntervalLowerBound": 0, "MetricIntervalUpperBound": 20,"ScalingAdjustment": 5}],"Cooldown": 60, "MetricAggregationType": "Average"}'

2. Then we need to associate the scaling policy from step 1 as an alarm action to the new CloudWatch alarm:

aws cloudwatch put-metric-alarm \
--alarm-name Test-ScaleOut --metric-name MemoryUtilization \
--namespace AWS/ECS --statistic Average --period 60 --threshold 60 \
--comparison-operator GreaterThanOrEqualToThreshold --evaluation-periods 1 --datapoints-to-alarm 1 \
--dimensions Name=ClusterName,Value=your-cluster Name=ServiceName,Value=your-service-name --unit Percent \
--alarm-actions "arn:aws:autoscaling:us-west-1:xxxxxxx:scalingPolicy:xxxxxx/Test-Step-scaling-policy-ScaleOut"

3. Finally, create another step scaling policy and CloudWatch alarm for the scale-in activity.

Also note that if the scale-out activity of the service is in progress, then any scale-in activity is allowed only after completing the scale-out activity.

For Target tracking policy:

We need to create a target tracking policy:

aws application-autoscaling put-scaling-policy \
--service-namespace ecs --scalable-dimension ecs:service:DesiredCount \
--resource-id service/<cluster>/<service-name> \
--policy-name Test-target-tracking-scaling-policy --policy-type TargetTrackingScaling \
--target-tracking-scaling-policy-configuration '{ "TargetValue": 75.0, "PredefinedMetricSpecification": {"PredefinedMetricType": "ECSServiceAverageCPUUtilization" }, "ScaleOutCooldown": 60,"ScaleInCooldown": 60}'

While creating the target tracking policy, Application Auto Scaling creates CloudWatch alarms for scaling in and scaling out according to the target value.

[Need help with more AWS queries? We’d be happy to assist]
 

Conclusion

 
To conclude, today we discussed the steps followed by our Support Engineers to help our customers to configure Amazon ECS Service Auto Scaling on Fargate.

Submit a Comment Cancel reply

Your email address will not be published. Required fields are marked *

Recent Posts

  • A 15-Minute Self-Hosted RAG Stack Tutorial: From Zero to Production
  • Designing Data Pipelines That Prevent Outages Across Global Systems
  • Deployment Automation: Deploy With Efficiency and Consistency
  • What Is Proactive Monitoring? A Complete Guide
  • AI Use Cases: How Artificial Intelligence Is Used Across Industries

Categories

  • Advanced Vulnerability
  • AI Services
  • AI Support
  • AIOps
  • Amazon Web Services (AWS)
  • Apache
  • API Integration
  • Application Development
  • Azure
  • Cloud Cost Optimization
  • Cloud Management
  • Cloud-Native Application
  • Cloudflare
  • cPanel
  • cPanel migration
  • Cyberpanel
  • DDoS
  • Development Service
  • DevOps
  • DevOps Consulting
  • DevSecOps
  • Digital Transformation
  • DigitalOcean
  • DirectAdmin
  • Docker
  • Drupal
  • Ecommerce
  • Filezilla
  • FTP
  • Google cloud platform
  • HAProxy
  • Headless CMS Integration
  • Hosting Support
  • IIS
  • Infrastructure Management & Optimization
  • Kubernetes
  • KVM
  • Laravel
  • Latest
  • Linode
  • Litespeed
  • LXC/LXD
  • Magento
  • Mobile App Development
  • MongoDB
  • Moodle
  • MySQL
  • NFS
  • Nginx
  • OnApp
  • Outsourced Support
  • OVH
  • ovirt
  • pfsense
  • Plesk
  • PostgreSQL
  • PowerDNS
  • Product Engineering
  • Proxmox
  • RedHat
  • Redis
  • Sendmail
  • Server Administration
  • Server Management
  • Software Development
  • SQLServer
  • Technical Support
  • UI/UX
  • Virtualizor
  • VMware
  • VPN
  • Vulnerability Scanning
  • Vultr
  • Web Development
  • Windows
  • WordPress
  • WordPress Hosting
  • WordPressHA

Subscribe to our newsletter

Footer newsletter

Email sales@bobcares.com | Phone 1-800-383-5193

Product Engineering

  • MVP Build
  • MVP to Scale
  • Product Maintenance

Digital Transformation

  • Process Digitization & Automation
  • Systems Integration & Workflow Orchestration
  • Data Enablement & Decision Support
  • Application & Platform Modernization
  • Transformation Execution & Delivery Enablement

AI Services

  • AI Readiness & Use-Case Discovery
  • AI Integration & Application Enablement
  • Intelligent Automation & AI Workflows

Infrastructure Management

  • Always-On Infrastructure Management
  • Proactive Monitoring & Incident Prevention
  • Cloud Cost Control & Optimization (FinOps)
  • Outsourced IT & End-User Support
  • Managed Infrastructure Execution Support

DevOps & Automation Services

  • CI/CD & Release Automation
  • Infrastructure as Code & Platform Standardization
  • Reliability Engineering & Observability
  • DevSecOps Enablement
Product Engineering +
Web Development MVP to Scale Builds Microservices Architecture Agile & Dev Team Augmentation Mobile Apps Ecommerce UI/UX Design QA & Test Automation
Digital Transformation +
Legacy Modernization Workflow Automation Data-Driven Dashboards CRM / ERP Integration Business Process Re-engineering
AI Services +
AI & Machine Learning AIOps Intelligent Automation Business Intelligence & Analytics AI Installation & Compute
Infrastructure Management +
Cloud Setup Cloud Migration Managed Cloud Services Server & Hosting Cost Optimization Performance Optimization Outsourced Support
DevOps & Automation Services +
CI/CD Setup Kubernetes & Docker Infrastructure as Code Cloud-Native Migration DevSecOps
Cybersecurity & Compliance Services +
Security Hardening VAPT Incident Response Backup & DR

© 2026 Bobcares. All Rights Reserved.

  • Careers
  • |
  • Cookie Policy
  • |
  • GDPR
  • |
  • Privacy Policy
  • |
  • Terms and Service
  • LinkedIn
  • YouTube
  • Instagram
  • Facebook

Preview of the new Bobcares experience
NEW UPDATE
See What’s New
at Bobcares

Discover a faster, clearer view of our services and expertise.


Explore the New Experience
Arrow Right