Horizontal vs. Vertical Scaling Flashcards
What is vertical scaling?
An example would be increasing the size of the virtual machine, like memory, cpu, etc.
Limited by the largest machine option available
What is horizontal scaling?
An example would be to make use of multiple virtual machines to spread out the work
Benefits:
1. Horizontal scaling has no limit, except maybe the cost
2. Increased high availability (can make use of multiple AZs)
3. Increased redundancy
4. Autoscaling options are available
What are the 3Ws of scaling?
- What do we scale? What resources are we going to scale? How do you define the template?
- Where do we scale? When applying the model, where does it go? Should we scale out databases, or web servers?
- When do we scale? How do we know we need more? CloudWatch alarms can tell us when it’s time to add more resources.
What is a launch template?
A launch template specifies all of the needed settings to go into building out an EC2 instance.
It is a collection of settings that you can configure so you don’t have to walk through the EC2 wizard over and over.
What is the difference between templates and configurations?
Templates:
1. More than just autoscaling
2. Supports versioning
3. More granularity
4. AWS supported
Configurations:
1. Only for autoscaling
2. Immutable
3. Limited configuration options
4. Don’t use them
What settings are available in an EC2 launch template?
- AMI
- EC2 instance size
- Security groups
- Networking information
- User data
If you define networking information in an EC2 launch template, what options won’t be available?
You can’t use the launch template in an auto-scaling group
What are auto-scaling groups in EC2?
Contains a collection of EC2 instances that are treated as a collective group for the purpose of scaling and management
What are the steps to setting up an auto-scaling group in EC2?
- Define your template: Define your EC2 launch template (launch template of launch configuration
- Networking and purchasing: Pick your networking and purchasing options (using multiple AZs allows for high availability)
- ELB configuration: EC2 instances can be registered behind a load balancer; the auto-scaling group can be set to respect the load balancer health checks
- Set scaling policies: Minimum, maximum and desired capacity needs to be set or to ensure you don’t have too many or too few resources
- Notifications: SNS can act as a notification tool, allowing you to let someone know when the scaling event occurs
What are the three auto-scaling restrictions?
- Minimum - the lowest number of EC2 instances you’ll ever have online (likely the lowest would ever be 2)
- Maximum - the highest number of EC2 instances you’ll ever provision
- Desired - how many instances do you want right now? it will never be lower than the minimum and never be higher than the maximum
How can you save money when using auto-scaling in EC2?
You can select to use spot instances
What option in EC2 is integral to making an application highly available?
Auto-scaling
Remember to select answers that spread resources out over multiple AZs and utilize load balancers
What is EC2 instance warm-up in auto-scaling?
Stops instances from being placed behind the load balancer, failing the health check, and being terminated
What is EC2 instance cool-down in auto-scaling?
Pauses auto-scaling for a set amount of time; helps to avoid runaway scaling events (default window is 5 minutes)
What does it mean to “avoid thrashing” in auto-scaling?
Create instances quickly and spin them down slowly