Vertical Scaling
Horizontal Scaling
- increases high availability
3 W’s of Scaling
What - what do we scale, where is the template coming from?
Where - where in the VPC does it make sense to scale? Which load balancer
When - When do I scale? Cloud Watch Alarms can tell us when to scale.
Launch template
Launch configuration
When given a choice between Launch Templates and Launch Configurations which do you choose?
Launch Templates
What goes into a Launch template?
Why don’t you want to put a VPC inside a launch template?
it would prohibit you doing a autoscaling group later
Can you change the bootstrap script in a Launch template
only if you create a new version of it
Auto-scaling Groups
Steps for creating an auto scaling group
1) pick your launch template
2) pick your VPC and network and purchasing options
3) configure your Elastic Load Balancer
4) set scaling policies (min, max, capacity)
5) set up notifications via SNS
When do you indicate that you want to use the load balancer health checks for auto scaling group?
Must choose the setting during configuration
Autoscaling limits
Minimum - the lowest # of EC2 instances you’ll ever have on line
Maximum - the highest # of EC2 instances
Desired Capacity - how many instances do you want right now - constantly changing.
Spot Instances in an auto scaling group
- can combine OnDemand and spot instances
How to get high availability?
How auto-scaling group can handle networking
select multiple subnets to spread across AZs
How can an auto scaling group notify you?
via SNS
Step Scaling
when there’s a check in based on a target value (ex: memory) and if it has 0 - 40% of the target it scales in, and if it has 60% - 100% of target, it scales out)
Instance Count scaling
when there’s a check in and it sees how many instances are currently healthy compared to the target number of instances.
Scaling Policies - Scaling out example
- Add 15 instances when memory usage is b/w 80 - 100%
Scaling Policies - Scaling in example
Warm up period
auto scaling hangs out and does not check the new instances
- auto scaling will continue to check necessary capacity, but takes into account that the new instances are warming up
Scaling tips
- Scale out aggressively Scale in conservatively.
Cool Down