Availability and Scalability - ASG Flashcards

1
Q

What is an Auto Scaling Group (ASG) in AWS?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What are the key parameters that define the capacity of an Auto Scaling Group?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What happens when the desired capacity exceeds the maximum capacity in an Auto Scaling Group?

A

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 well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

How does an Auto Scaling Group work with a Load Balancer?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What happens if an EC2 instance in an Auto Scaling Group becomes unhealthy?

A

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 well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

How does scaling out (adding EC2 instances) work with an Auto Scaling Group?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is a Launch Template used for in an Auto Scaling Group?

A

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 well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

How does Auto Scaling integrate with CloudWatch?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What are Scaling Policies in an Auto Scaling Group?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What is the default behavior of an Auto Scaling Group when scaling out?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is the cost model for Auto Scaling Groups?

A

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 well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

How does Auto Scaling help with Fault Tolerance?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Can you use Auto Scaling with multiple Availability Zones?

A

Yes, Auto Scaling can distribute EC2 instances across multiple Availability Zones for better fault tolerance and availability.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

How does Auto Scaling determine when to scale in (remove EC2 instances)?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What is the benefit of using Auto Scaling in AWS?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What are the different types of scaling policies available in an Auto Scaling Group?

A

The main types of scaling policies are:

Dynamic Scaling:
Target Tracking Scaling
Simple/Step Scaling

Scheduled Scaling

Predictive Scaling

17
Q

What is Target Tracking Scaling in Auto Scaling?

A

Target Tracking Scaling automatically adjusts the number of EC2 instances in an ASG to maintain a specified target value for a given metric (e.g., CPU utilization). For example, if you set a target of 40% CPU utilization, the ASG will automatically scale in or out to maintain this target.

18
Q

What is Simple/Step Scaling in Auto Scaling?

A

Simple Scaling is a scaling policy where you define CloudWatch alarms to trigger scaling actions, such as adding or removing EC2 instances based on certain thresholds for metrics like CPU utilization or request count.

19
Q

What is Scheduled Scaling in Auto Scaling?

A

Scheduled Scaling allows you to anticipate scaling actions based on known patterns, such as higher traffic during certain times (e.g., 5:00 PM on Fridays). You can set scaling actions in advance to adjust the minimum or desired capacity.

20
Q

What is Predictive Scaling in Auto Scaling?

A

Predictive Scaling uses historical data to forecast future load patterns. The ASG then schedules scaling actions ahead of time based on the forecast, which is useful for applications with predictable, cyclical traffic patterns.

21
Q

What are some common metrics to scale on in Auto Scaling?

A

CPU Utilization: Common for compute-bound applications.

RequestCountPerTarget: Useful when you know your EC2 instances handle a specific number of requests optimally.

Network In/Out: Used for network-bound applications (e.g., file uploads or downloads).

Custom Metrics: Any custom metrics you define in CloudWatch based on your application’s specific needs.

22
Q

What is the Scaling Cooldown period in an Auto Scaling Group?

A

Scaling Cooldown is the period after a scaling action (scale out or scale in) where the ASG will not launch or terminate any additional instances. The default cooldown period is 300 seconds (5 minutes). This allows metrics to stabilize and ensures the scaling action has taken effect.

23
Q

Why is the Scaling Cooldown period important in Auto Scaling?

A

The cooldown period prevents rapid, consecutive scaling actions that could result in instability. It ensures that the new instances have time to fully launch and the system has stabilized before another scaling action is triggered.

24
Q

How can you reduce the cooldown period and improve scaling efficiency in Auto Scaling?

A

To reduce the cooldown period and improve scaling efficiency, you can use a ready-to-use AMI. This minimizes the time required to configure new EC2 instances, allowing them to be fully operational more quickly. Additionally, enabling detailed monitoring ensures metrics are updated every minute, improving scaling responsiveness.

25
Q

What is the default scaling cooldown period in an Auto Scaling Group?

A

The default scaling cooldown period is 300 seconds (5 minutes). During this time, the ASG will not initiate additional scaling actions to avoid over-scaling or under-scaling due to temporary metric fluctuations.

26
Q

How does CloudWatch integrate with Auto Scaling?

A

CloudWatch provides the metrics used to trigger scaling actions. CloudWatch alarms are set based on these metrics (like CPU utilization or request count). When an alarm is triggered, it automatically activates a scaling policy to scale in or out an Auto Scaling Group.