Auto Scaling Groups Flashcards

1
Q

What is the goal of an Auto Scaling Group

What are the 4 capacity parameters of an Auto Scaling Group

A

To be able to scale out to match increased load, scale in to match decreased load and insure there is a minimum number of machines running

Initial, Current size, Minimum size, Maximum size.

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

What are the key configurations of an Auto Scaling Group?

How do you update an ASG?

A
AMI + Instance Type
EC2 User Data
EBS Volumes
Security Groups
SSH Keypair
Subnets
Min, Max, Initial Capacity

Define a new launch configuration

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

How does an auto scaling alarm trigger scaling in/out for an auto scaling group?

What are some of the new auto scaling rules available?

How can you define a custom metric?

What happens if an instances is deemed unhealthy by a load balancer?

A

A cloud watch alarm can be configured to measure some aggregate metrics such as CPU usage for all instances within an ASG. Based on this metric, the ASG will scale in or out

Target Average CPU Usage
Number of requests on the ELB per instance
Average network in
Average network out

  1. Send a custom metric from EC2 app to cloud watch using the put metric API
  2. Create a clout watch alarm to react to low/high values
  3. Use the CloudWatch alarm as the scaling policy for ASG

The ASG will replace that insance

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

What happens if you attach IAM roles to an ASG?

How much is an ASG?

A

They will also get assigned to the EC2 instances in the ASG

Free, you pay for the underlying resources being launched

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

What are the three types of dynamic scaling policies for an auto scaling group and how do they work?

What is predictive scaling?

A
  1. Target Tracking Scaling - Define an average metric that should be met by all instances such as the average cpu usage, then scale to meet that target
  2. Simple / Step Scaling - When a cloud watch alarm is triggered, such as CPU > 70%, then add 2 units. When it goes below 30 percent, remove one unit
  3. Scheduled actions - Anticipate scaling based on known usage patterns. Ex increace the min capacity to 10 at 5pm on Fridays.

Predictive scaling provides a way for the ASG to scale automatically based on past historical usage.

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

What are some good metrics to scale on?

What is an auto-scaling group scaling cooldown?

How long is the default time period?

A

CPUUtilization
RequestCoutPerTraget
Average Network In / Out
Any custom metric

The cooldown period defines a period after a scaling event to wait before scaling again. This will allow the applications to stabilize

The default period is 300s

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

How does the default termination policy work for an ASG?

A
  1. Find the az which has the most number of instances

2. If there are multiple instances in that AZ, delete the one with the oldest launch configuration

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

What are the two ASG life-cycle hooks and what are they useful for

A

Instance launching lifecycle hook which will launch an instance but wait before adding it to an ASG in order to allow you to add additional configurations or install additional software

Instance terminating hook which allows you to do things like extract data before an instance is fully terminated.

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

What’s the difference between a launch configuration and a launch template?

A

Launch configuration is legacy and must be recreated every time

Launch template gives you:
Provision using On-Demand and Spot instances
Multiple versions
Create parameter subsets using inheritance
Provision using On-Demand and Spot instances
Can use T2 unlimited burst feature
Recommended by AWS going forward.

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