Auto Scaling Groups Flashcards
What is the goal of an Auto Scaling Group
What are the 4 capacity parameters of an Auto Scaling Group
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.
What are the key configurations of an Auto Scaling Group?
How do you update an ASG?
AMI + Instance Type EC2 User Data EBS Volumes Security Groups SSH Keypair Subnets Min, Max, Initial Capacity
Define a new launch configuration
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 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
- Send a custom metric from EC2 app to cloud watch using the put metric API
- Create a clout watch alarm to react to low/high values
- Use the CloudWatch alarm as the scaling policy for ASG
The ASG will replace that insance
What happens if you attach IAM roles to an ASG?
How much is an ASG?
They will also get assigned to the EC2 instances in the ASG
Free, you pay for the underlying resources being launched
What are the three types of dynamic scaling policies for an auto scaling group and how do they work?
What is predictive scaling?
- 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
- 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
- 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.
What are some good metrics to scale on?
What is an auto-scaling group scaling cooldown?
How long is the default time period?
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 does the default termination policy work for an ASG?
- 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
What are the two ASG life-cycle hooks and what are they useful for
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.
What’s the difference between a launch configuration and a launch template?
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.