ASG and ELB Flashcards
What is the advantage of using launch template instead of launch configuration in ASG?
You can only use a launch template to provision capacity across multiple instance types using both On-Demand Instances and Spot Instances to achieve the desired scale, performance, and cost
Default Termination Policy
- Pick AZ with most instances and one or more instances not protected from scale in
- Determine if instance is outside of allocation strategy for on-demand or spot (e.g. instance type re-prioritization)
- Determine if any of the instances have oldest launch template or configuration - termination policy prefers configs over templates
- Determine which instance is the closest to the next billing hour
Amazon EC2 Auto Scaling lifecycle hooks
Popular use cases
enable an Auto Scaling group to be aware of events in the Auto Scaling instance lifecycle, and then perform a custom action when the corresponding lifecycle event occurs. A lifecycle hook provides a specified amount of time (one hour by default) to complete the lifecycle action before the instance transitions to the next state.
Popular uses of lifecycle hooks
- control when instances are registered with Elastic Load Balancing
-Install or configure software on newly launched images
-Download log files form instance before it terminates
Scheduled scaling
Scheduled scaling helps you to set up your own scaling schedule according to predictable load changes.
To use scheduled scaling, you create scheduled actions. Scheduled actions are performed automatically as a function of date and time.
Predictive scaling is well suited for what situations
Cyclical traffic, such as high use of resources during regular business hours and low use of resources during evenings and weekends
Recurring on-and-off workload patterns, such as batch processing, testing, or periodic data analysis
Applications that take a long time to initialize, causing a noticeable latency impact on application performance during scale-out events
Predictive scaling is well suited for what situations
Cyclical traffic, such as high use of resources during regular business hours and low use of resources during evenings and weekends
Recurring on-and-off workload patterns, such as batch processing, testing, or periodic data analysis
Applications that take a long time to initialize, causing a noticeable latency impact on application performance during scale-out events
predictive scaling
Use predictive scaling to increase the number of EC2 instances in your Auto Scaling group in advance of daily and weekly patterns in traffic flows.
scaling cooldown
helps you prevent your Auto Scaling group from launching or terminating additional instances before the effects of previous activities are visible.
What are Step adjustments? What is specified in a Step adjustment?
They increase or decrease the current capacity of your Auto Scaling group, based on the size of the alarm breach.
Specify the following:
A lower bound for the metric value
An upper bound for the metric value
The amount by which to scale, based on the scaling adjustment type
What do step and simple scaling policies have in common?
- require you to create CloudWatch alarms
- require you to specify the high and low thresholds for the alarms.
- define whether to add or remove instances, and how many, or set the group to an exact size
What is the main difference in step and simple scaling policies?
The main difference between the policy types is the step adjustments that you get with step scaling policies. When step adjustments are applied, and they increase or decrease the current capacity of your Auto Scaling group, the adjustments vary based on the size of the alarm breach.
In most cases, step scaling policies are a better choice than simple scaling policies, even if you have only a single scaling adjustment.
step scaling the policy can continue to respond to additional alarms, even while a scaling activity or health check replacement is in progress
What are the types of AWS dynamic scaling policies?
Target tracking scaling—Increase or decrease the current capacity of the group based on a target value for a specific metric. This is similar to the way that your thermostat maintains the temperature of your home—you select a temperature and the thermostat does the rest. e.g. # of messages in SQS queue
Step scaling—Increase or decrease the current capacity of the group based on a set of scaling adjustments, known as step adjustments, that vary based on the size of the alarm breach. e.g. 90% CPU over specific time frame.
Simple scaling—Increase or decrease the current capacity of the group based on a single scaling adjustment.
What are the types of AWS dynamic scaling policies?
Target tracking scaling—Increase or decrease the current capacity of the group based on a target value for a specific metric. This is similar to the way that your thermostat maintains the temperature of your home—you select a temperature and the thermostat does the rest. e.g. # of messages in SQS queue
Step scaling—Increase or decrease the current capacity of the group based on a set of scaling adjustments, known as step adjustments, that vary based on the size of the alarm breach. e.g. 90% CPU over specific time frame.
Simple scaling—Increase or decrease the current capacity of the group based on a single scaling adjustment.
What is dynamic scaling policy?
A dynamic scaling policy instructs Amazon EC2 Auto Scaling to track a specific CloudWatch metric, and it defines what action to take when the associated CloudWatch alarm is in ALARM.
Metrics are averaged across the ASG. e.g. two instances, one CPU=40% and the other CPU=60%, avg CPU = 50% will be considered to determine CPU for the group.
List and Describe ALB Content Routing Methods
Host-based Routing : You can route a client request based on the Host field of the HTTP header allowing you to route to multiple domains from the same load balancer.
Path-based Routing : You can route a client request based on the URL path of the HTTP header.
HTTP header-based routing : You can route a client request based on the value of any standard or custom HTTP header.
HTTP method-based routing : You can route a client request based on any standard or custom HTTP method.
Query string parameter-based routing : You can route a client request based on query string or query parameters.
Source IP address CIDR-based routing : You can route a client request based on source IP address CIDR from where the request originates.
ALB Targets & Description
IP addresses as Targets
You can load balance any application hosted in AWS or on-premises using IP addresses of the application backends as targets.
Lambda functions as Targets
Application Load Balancers support invoking Lambda functions to serve HTTP(S) requests enabling users to access serverless applications from any HTTP client, including web browsers.
EC2 Instances
Containers -provides enhanced container support by load balancing across multiple ports on a single Amazon EC2 instance. Deep integration with the Amazon Elastic Container Service (ECS), provides a fully-managed container offering.
ALB HTTPS Support
An Application Load Balancer supports HTTPS termination between the clients and the load balancer. Application Load Balancers also offer management of SSL certificates through AWS Identity and Access Management (IAM) and AWS Certificate Manager for pre-defined security policies.
Scope of ASG
AZ
ASG Standby State
You can put an instance that is in the InService state into the Standby state, update some software or troubleshoot the instance, and then return the instance to service. Instances that are on standby are still part of the Auto Scaling group, but they do not actively handle application traffic.
ReplaceUnhealthy
terminates instances that are marked as unhealthy and then creates new instances to replace them.
Check if time…What happens when ReplaceUnhealthy is suspended? unsuspended?
Amazon EC2 Auto Scaling stops replacing instances that are marked as unhealthy. Instances that fail EC2 or Elastic Load Balancing health checks are still marked as unhealthy. As soon as you resume the ReplaceUnhealthly process, Amazon EC2 Auto Scaling replaces instances that were marked unhealthy while this process was suspended.
Scope of ELB service
ELB is a regional service
ALB Targets
IP addresses
Lambda functions
EC2 Instances
Containers?
Describe the ALB IP Address Target
What restrictions apply to the ALB itself with respect to IP?
You can load balance any application hosted in AWS or on-premises using IP addresses of the application backends as targets
Only private IPs can be used
ALB can’t be assigned an Elastic IP (static IP)