DAY-9 AWS-CSA
1] what is an auto scaling group ?
An Auto Scaling Group (ASG) is a feature in cloud computing that automatically adjusts the number of instances (virtual machines) in response to changing demand. It helps maintain application availability and optimize costs by scaling up (adding instances) when traffic increases and scaling down (removing instances) when demand decreases.
Key Features of an Auto Scaling Group:
How It Works:
Use Case Examples:
2] Auto scaling group in AWS With load balancer
In AWS, an Auto Scaling Group (ASG) works with an Elastic Load Balancer (ELB) to ensure high availability and fault tolerance for your applications. The ASG automatically scales instances up or down based on demand, while the ELB distributes incoming traffic across healthy instances.
How It Works
Benefits of ASG with ELB
? High Availability – Ensures traffic is always served, even if instances fail.
? Automatic Scaling – Adds/removes instances based on demand.
? Load Balancing – Distributes traffic evenly for better performance.
? Cost Optimization – Avoids over-provisioning and saves costs.
3] Auto Scaling Group Attributes
An Auto Scaling Group (ASG) in AWS has several attributes that control how instances are launched, managed, and scaled. These attributes define the behavior of the ASG and help optimize performance, availability, and cost efficiency.
? Summary
An Auto Scaling Group (ASG) is a powerful tool that manages EC2 instances dynamically. Its attributes control:
4] Auto Scaling Groups - Scaling Policies
Auto Scaling Groups (ASGs) in AWS automatically adjust the number of EC2 instances based on demand. Scaling policies define how instances are added or removed, ensuring cost efficiency and performance.
1?? Dynamic Scaling (Real-time Auto Scaling)
Dynamic scaling policies adjust the number of instances in response to real-time traffic changes.
?? Target Tracking Scaling
? Best For: Maintaining a stable metric value over time (e.g., CPU usage, request count). ?? Example Metric:
?? Simple Scaling & Step Scaling
? Best For: Gradual or tiered scaling based on workload changes. ?? Use Case: Handling sudden traffic spikes effectively.
2?? Scheduled Scaling (Time-based Scaling)
? Best For: Predictable workloads (e.g., e-commerce sales, batch jobs, office hours).
3?? Predictive Scaling (AI-driven Auto Scaling)
? Best For: Applications with seasonal trends or fluctuating demand (e.g., retail websites before holidays).
领英推荐
5] Good metrics to scale on
1?? CPU Utilization (CPUUtilization)
? Best For: Compute-heavy applications (e.g., web servers, APIs, machine learning models). ?? Scaling Strategy:
?? Example Rule:
2?? Request Count Per Target (RequestCountPerTarget)
? Best For: Load balancer-based scaling (e.g., ALB/NLB-backed applications). ?? Scaling Strategy:
?? Example Rule:
3?? Average Network In/Out (NetworkIn / NetworkOut)
? Best For: Applications with high network traffic (e.g., video streaming, file transfer, gaming servers). ?? Scaling Strategy:
?? Example Rule:
4?? Custom Metrics (CloudWatch Custom Metrics)
? Best For: Specialized scaling needs beyond built-in AWS metrics. ?? Examples:
?? Example Rule:
6] Auto Scaling Groups - Scaling cooldowns
A scaling cooldown is a waiting period after an Auto Scaling action (scale-in or scale-out) to prevent excessive scaling and ensure the system stabilizes before triggering another scaling action.
1?? Types of Cooldowns in AWS Auto Scaling
?? Default Cooldown
? Best For: General ASG setups without custom tuning.
?? Scaling Policy Cooldown
?? Example Use Case:
? Best For: More precise scaling behavior per policy.
?? Instance Refresh Cooldown
? Best For: Rolling updates to ASG instances.
?? Warm Pool Cooldown (For Pre-Warmed Instances)
? Best For: Faster scaling by keeping pre-initialized instances ready to go.
3?? When to Adjust Cooldowns?
? Decrease cooldown time if:
? Increase cooldown time if: