Elastic Load Balancer Flashcards
What is the goal of high availability?
What are some of the ways you can achieve high availability?
To survive a data center loss
Use an autoscaling group in multi-az
Run a load balancer in multi az
Why are health checks useful for load balancers?
They enable the load balancer to see which EC2 instances are healthy
What are the 2 ways you can set up Elastic load balancers?
You can set up internal (private) or external (public) ELBs
What is a common way to set up a security group for a load balancer?
Create a security group for the traffic from the user to the ELB, then set up another security group between the ELB and the EC2 instance, that security group should allow all traffic from the ID of the first security group be routed to the EC2 instance.
What HTTP error will be returned if the ELB is at capacity or there is no registered target?
What should you check if the load balancer can’t connect to your EC2 instnace?
What can you see in ELB access logs?
What does cloud watch provide for ELB?
HTTP 503
The security groups
Logs of all access requests
Aggregate statistics Ex connections count
What network protocols does a classic load balancer support?
Which protocols can be used for health checks?
How do you point to an classic load balancer?
TCP (Layer 4) and HTTP & HTTPS (Layer 7)
TCP or HTTP
Through a fixed hostname
How do you define a classic load balancer?
- define a load bancer
- Assign security groups
- Configure security settings like HTTPS
- Configure health check
- Add ec2 instances
What protocols does an application load balancer (ALB) support?
What types of load balancing does an application load balancer support
Does an application load balancer support re-directs?
Layer 7 (HTTP). Also supports http2 and WebSocket/gRPC
Load balancing across multiple applications across machines (target groups)
Load balancing to multiple applications on the same machine. Ex containers
Yes, for example, you can redirect from http to https
What are some of the ways an application load balancer can route requests?
What’s the big difference between a classic load balancer and an application load balancer?
How does an application load balancer achieve routing to multiple applications?
At what level are the health checks run for an application load balancer?
Requests can be routed via, path, hostname, query string
An application load balancer is designed to support multiple applications. This is great for micro-services. A classic load balancer on the other hand can only support one application.
By being able to route to multiple target groups?
At the target group level
What are some examples of target groups?
How do EC2 instances see the IP address of the client that is actually calling?
EC2 intances, ECS tasks, Lambda functions, IP Addresses
By checking the X-Forwarded-For header
What layer does a network load balancer support?
What is the use-case for a network load balancer?
How do you connect to a network load balancer?
How could you configure a secondary way to connect through a Network load balancer?
Layer 4 (TCP & UDP)
They are used for extreme performance use cases. They are able to handle millions of requests per second with ~100ms latency
They expose a static IP address?
You can configure an elastic IP.
What are sticky sessions?
What types of ELBs do sticky sessions work for?
What is one of the pitfalls of using sticky sessions?
What are the two types of cookies that can be used for sticky sessions
Sticky session allow the same client to always be redirected to the same instance behind the load balancer by providing a cookie?
Classic and application load balancers
Can cause an imbalance on some instances
Application based sticky session cookies that is generated by the target app.
Duration based cookies that is generated by the load balancer and active for all target groups for a period of time determined by the load balancer.
How is traffic distributed with cross zone load balancing.
In a cross-zone load balancing scenario with ELB, what is the default configuration and pricing for inter AZ data for an Application load balancer?
What about for a network load blanacer?
What about for a classic load balancer?
With cross zone load blanancing, the load blancers will distribute the traffics across all ec2 instances in ALL ZONES
Cross zone load balancer is always on (can’t be disabled) and there is no charge for inter-az data
It is disabled for by default, you pay a charge for inter-az data if enabled
It is enabled by default through the console. It is disabled by default through the API/CLI, No charges for inter-az data
What problem does Server Name Indication (SNI) solve?
How does it work?
Which load balancers does Server Name Indication work for?
SNI solves the problem of loading multiple SSL certificates on a web server to serve multiple websites.
The client must indicate the name of the host it wants to reach in the initial SSL handshake. Then the server will load the corresponding certificate.
ALB and NLB
Does not work for CLB
What is connection draining?
What is the default time and and time range for connection draining?
Connection draining defines the time that the load balancer will wait to terminate inflight requests when an ec2 instance is deemed unhealthy.
The default is 300 seconds, but can be between 1 and 3600 seconds.