Chapter 11 - Elastic Load Balancing Flashcards
Application Load Balancers
Which is Layer 7
- It only support HTTP and HTTPS.
- And to use an HTTPS listener, you must deploy at least one SSL or TLS server certificate on your load balancer.
- And the load balancer uses the server certificate
- to terminate the frontend connection
- to decrypt the requests from your clients before sending them to the targets.
- also have sticky sessions
- you can enable sticky sessions for your Application Load Balancer,
- but it’s going to be sent to the target group level, not to to the individual EC2 instances.
Network Load Balancers
which are Layer 4
- You’re going to use them when you need extreme performance.
- Other use cases are where you need protocols that are not supported by Application Load Balancers.
- And Network Load Balancers can also decrypt your traffic, but you’re going to need to install the certificate on the load balancer.
Classic Load Balancers
which operate between Layer 4 and Layer 7
- Remember what a 504 error means.
- It just means that the gateway has timed out.
- And this means your application is not responding within the idle timeout period.
- And to basically solve this, you just need to troubleshoot the application.
health check
You can use health checks to route your traffic to instances or targets that are healthy.
Application Load Balancers - listener
- A listener checks for connection requests from clients using the protocol and the port that you configure.
- So, it’s either going to be port 80 or port 443.
rules
These determine how the load balancer routes your request to its registered target.
And each rule consists of:
- a priority
- one or more actions
- and one or more conditions
target groups
basically each target group routes requests to one or more registered targets
- Such as our EC2 instances
- Using the protocol and port numbers that you specify.
X-Forwarded-For header
if you need the IPv4 address of your end user
sticky sessions
They enable your users to stick to the same EC2 instance.
- And this can be useful if you’re storing information locally to that instance.
- And you may see scenario based questions where you remove an EC2 instance from a pool that the load balancer continues to direct traffic to that EC2 instance.
- In a scenario like that, you just need to disable sticky sessions.
deregistration delay or connection draining
Depending on if it’s an Application Load Balancer or a Classic Load Balancer, they’re exactly the same thing.
- So, you basically want to enable deregistration delay and this will keep existing connections open if the EC2 instance becomes unhealthy.
- Or you could choose to disable deregistration delay or connection draining
- You do this if you want your load balancer to immediately close connections to the instances that deregistered or that have become unhealthy.