Day 73 of 90 Days of DevOps Challenge: Autoscaling in AWS

Vaishnavi DVaishnavi D
3 min read

On Day 72 of the #90DaysOfDevOpsChallenge, I explored the concept of Elastic Load Balancers (ELB) in AWS, which distribute incoming traffic across multiple EC2 instances to ensure high availability, fault tolerance, and smooth traffic management. I covered Application Load Balancers, Network Load Balancers, Classic Load Balancers, and all key components like Listeners, Target Groups, and Health Checks.

Today, I’m diving into another crucial cloud-native concept: Scaling and how Auto Scaling Groups (ASG) help achieve elasticity and cost-efficiency in cloud environments.

What is Scaling in Cloud?

Scaling means adjusting your infrastructure capacity based on demand, adding or removing computing power (like EC2 instances) as needed.

There are two types:

1. Vertical Scaling (Scaling Up/Down)

  • Increases the capacity of a single instance (e.g., from t2.micro to t2.large)

  • More CPU, memory, storage

  • Faster to implement, but has limits (hardware ceiling)

  • Downtime may be required

When to use:

  • Simple workloads

  • Apps that can't be distributed across instances

2. Horizontal Scaling (Scaling Out/In)

  • Adds more instances to distribute the load

  • True cloud-native approach, stateless & distributed

  • Supports high availability & redundancy

  • Requires load balancers and session management

When to use:

  • Web apps, APIs, microservices

  • Spiky traffic patterns

  • Scalable backend architectures

What is Auto Scaling?

Auto Scaling in AWS allows you to automatically launch or terminate EC2 instances based on real-time metrics (CPU usage, memory, request count, etc.).

This is where Auto Scaling Groups (ASG) come into play.

What is an Auto Scaling Group (ASG)?

An Auto Scaling Group is a logical grouping of EC2 instances with the ability to:

  • Maintain instance count (even if some fail)

  • Scale out/in automatically

  • Integrate with CloudWatch alarms, Load Balancers, and Launch Templates

Key Components of Auto Scaling

1. Launch Template/Configuration

  • Defines the AMI, instance type, key pair, security groups, and other settings.

2. Minimum, Maximum & Desired Capacity

  • Min: Minimum number of running instances

  • Max: Upper limit of scale

  • Desired: Preferred count (starts with this)

3. Scaling Policies

  • Target Tracking: Keeps metrics at a target value (e.g., CPU at 60%)

  • Step Scaling: Scales gradually based on metric thresholds

  • Scheduled Scaling: Based on time-based triggers (e.g., increase capacity during business hours)

4. Health Checks

  • Ensures only healthy instances stay in rotation

  • Unhealthy ones are replaced automatically

5. Integration with Load Balancers

  • Traffic is evenly distributed as new instances come and go

  • ALBs and ASGs work hand-in-hand

Steps to Set Up Auto Scaling in AWS:

  1. Create Launch Template

    • Choose AMI, instance type, key pair, and security groups
  2. Create an Auto Scaling Group

    • Attach the Launch Template

    • Set Min, Max, and Desired capacity

    • Configure subnets and Load Balancer (optional)

    • Define health check type (EC2 or ELB)

    • Add scaling policies (Target tracking is most common)

  3. Monitor and Optimize

    • Use CloudWatch to monitor metrics

    • Adjust policies as needed based on traffic trends

Why Scaling Matters in DevOps?

  • Keeps applications resilient and available

  • Optimizes costs by matching resource usage to demand

  • Enables CI/CD pipelines to deploy across fleets, not single servers

  • Supports blue-green deployments and rolling updates

  • Ensures a better user experience even during peak traffic

Final Thoughts:

Scaling, both vertical and horizontal, is more than just handling traffic; it’s about building resilient, cost-efficient, and production-ready infrastructure. Learning about AWS Auto Scaling Groups opened my eyes to how automation and elasticity are at the heart of modern DevOps practices. With the ability to dynamically adjust resources based on demand, we not only optimize performance but also control costs effectively.

Stay tuned for tomorrow’s dive into the next powerful AWS service in the DevOps toolkit!

0
Subscribe to my newsletter

Read articles from Vaishnavi D directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Vaishnavi D
Vaishnavi D