ELB and ASG Flashcards
(25 cards)
Describe scalability and compare vertical vs horizontal scalability?
Scalability means the system can handle greater loads by adapting
- Vertical scalability: Increasing the size/power of the underlying infra
- Horizontal scalability: Increasing the number of instances within the system
What is an ELB?
An ELB is an Elastic Load Balancer which provides a singular access point which will distribute incoming traffic to multiple downstream instances
What are the purposes of health checks?
Allows an Elastic Load Balancer to mark instances as unhealthy, meaning it wont be forwarded traffic
What are the 4 types of managed load balancers?
- Classic load balancer (Depreciated)
- Application load balancer
- Network load balancer
- Gateway load balancer
What layer does the ALB work on? What are the best use cases for ALB?
Layer 7, so it supports HTTP/HTTPS and redirects and mainly works with the url. Best supports microservices and container based applications (Docker and ECS).
How can an application behind a application load balancer determine the IP address of the client?
It is stored in the X-Forwarded-For header aswell as having X-Forwarded-Port and X-Forwarded-Proto
What layer does NLB work on? What does this mean and what are it’s main characteristics?
Layer 4, so deals with TCP and UDP traffic to instances. Can handle millions of requests per second and are ultra-low latency
How many IP’s can an NLB have per AZ?
One static IP per AZ and supports assigning elastic ip
What protocols does the NLB support for health checks?
TCP, HTTP and HTTPS
When would you want to use a GLB?
When you require all traffic to come through a firewall, intrusion detection system, or deep packet inspection system
What layer does GLB work on?
Layer 3, using the GENEVE protocol on port 6081
What is a use case of sticky sessions (session affinity)?
When you require a client to always be redirected to the same instance behind the load balancer
What 2 kinds of cookies do sticky sessions use and what sets them?
- Application-based cookie (The application)
- Duration-based cookie (The load balancer)
Describe how traffic is distributed when cross zone load balancing is enabled versus disabled.
Enabled - Each load balancer instance distributes evenly across all registered instances in AZ
Disabled - Requests are only distributed across nodes in the same AZ as the request
Which load balancers have cross zone load balancing enabled by default with no charges for inter AZ data, and which have it disabled with charges?
Application load balancer - Enabled by default with no charges
Network load balancer and Gateway load balancer - Disabled with charges
What does enabling SNI on a load balancer do, what is one use case for SNI, and what load balancers support SNI?
SNI requires the client to indicate the hostname of the target serer on the initial SSL handshake allowing the load balancer to find the correct certificate to present to the client. This allows multiple HTTPS domains on a single load balancer. ALB and NLB support this feature.
What is a Deregistration Delay?
A configurable delay prior to terminating an EC2 instance to allow in-flight requests
What does an ASG allow you to do?
Scale out (add) or scale in (remove) EC2 instances to match the load to the application aswell as managing the termination and reprovisioning of unhealthy EC2 instances
What is the purpose of a launch template for ASG’s?
Define things like the AMI/Instance type, EC2 User Data, EBS volumes, security groups etc
What service can be configured to monitor usage and increase allocation within an ASG?
CloudWatch alarms can be configured to track metrics like Average CPU (or custom metrics) to calculate the number of instances that should be running
Define target tracking vs step scaling for ASG’s
- Target tracking - Average CPU to stay around X
- Simple / step - When a CloudWatch alarm is triggered, add X units
If you are aware of patterns in traffic coming to your application, what scaling method could be useful?
Scheduled scaling - Increase capacity to X at 5pm on Fridays
What scaling method allows AWS to automatically scale your application based on forecasted traffic?
Predictive scaling
Shortly after a scaling activity occurs, the traffic to the application drastically falls however no new scaling activity occurs. What is a possible cause?
The cooldown period (default of 300 seconds) is a period of time where no new scaling activity will occur after a scaling activity is completed.