Availability and Scalability - ASG Flashcards
What is an Auto Scaling Group (ASG) in AWS?
An Auto Scaling Group (ASG) automatically adjusts the number of EC2 instances to meet the demands of your application by scaling out (adding instances) or scaling in (removing instances) based on load.
What are the key parameters that define the capacity of an Auto Scaling Group?
The key parameters for an ASG are:
Minimum Capacity: The minimum number of instances that should always be running.
Desired Capacity: The target number of instances the ASG tries to maintain.
Maximum Capacity: The maximum number of instances the ASG can scale up to.
What happens when the desired capacity exceeds the maximum capacity in an Auto Scaling Group?
The Auto Scaling Group (ASG) will not scale beyond the maximum capacity. If the desired capacity is greater than the maximum, the ASG will scale to the maximum limit.
How does an Auto Scaling Group work with a Load Balancer?
An ASG works with a load balancer by automatically registering new EC2 instances to the load balancer. The load balancer then distributes traffic across all healthy instances, ensuring high availability and fault tolerance.
What happens if an EC2 instance in an Auto Scaling Group becomes unhealthy?
If an EC2 instance becomes unhealthy (as determined by the load balancer’s health checks), the ASG will terminate the unhealthy instance and launch a new EC2 instance to replace it.
How does scaling out (adding EC2 instances) work with an Auto Scaling Group?
When scaling out, the ASG launches new EC2 instances to handle increased traffic. The load balancer will automatically start sending traffic to these new instances, distributing the load more evenly.
What is a Launch Template used for in an Auto Scaling Group?
A Launch Template provides the configuration for launching EC2 instances in an ASG, including the AMI, instance type, EBS volumes, security groups, IAM roles, network settings, and more.
How does Auto Scaling integrate with CloudWatch?
CloudWatch monitors metrics like CPU utilization, and when certain thresholds are reached, it triggers scaling policies in the Auto Scaling Group. For example, if CPU usage is too high, CloudWatch will trigger a scale-out policy to add more EC2 instances.
What are Scaling Policies in an Auto Scaling Group?
Scaling Policies define the conditions under which an Auto Scaling Group scales in or out. They can be triggered by CloudWatch alarms based on metrics (e.g., CPU utilization), and can specify the action to take, such as adding or removing EC2 instances.
What is the default behavior of an Auto Scaling Group when scaling out?
When scaling out, the ASG will increase the number of EC2 instances to match increased load, and the load balancer will start routing traffic to the new instances.
What is the cost model for Auto Scaling Groups?
Auto Scaling Groups themselves are free. You only pay for the resources that are created and used, such as EC2 instances and associated resources (e.g., EBS volumes, data transfer).
How does Auto Scaling help with Fault Tolerance?
Auto Scaling ensures fault tolerance by replacing unhealthy EC2 instances and automatically adjusting the number of instances based on demand. If an instance fails, it is terminated, and a new one is launched to maintain the desired capacity.
Can you use Auto Scaling with multiple Availability Zones?
Yes, Auto Scaling can distribute EC2 instances across multiple Availability Zones for better fault tolerance and availability.
How does Auto Scaling determine when to scale in (remove EC2 instances)?
Auto Scaling scales in based on CloudWatch alarms or custom policies that detect decreased load (e.g., low CPU utilization), triggering a decrease in the number of running EC2 instances.
What is the benefit of using Auto Scaling in AWS?
Auto Scaling allows you to automatically adjust the number of EC2 instances in response to changing traffic loads, optimizing costs, maintaining performance, and ensuring high availability of your application.