Elastic Load Balancer

  • AWS offers three different types of load balancers in AWS, they are as below,
    • Application Load Balancer
    • Network Load Balancer
    • Classic Load Balancer
  • Application Load Balancer – They are best suited for load balancing the HTTP and HTTPS traffic. They operate at layer 7 (TCP layers) and are application-aware. They are intelligent and can create advance request routing, sending specific requests to specific web servers.
  • Note –
    • One subnet is equal to one availability zone.
    • You will need to register the target (Load balancer) to the instance to assign it instance.
  • Network Load Balancer – They are required for load balancing where extreme performance is required. They operate at layer 4. They are capable of handling millions of requests per second while maintaining ultra-low latency.
  • Classic Load Balancer – They are legacy Elastic load balancers. It can be used for load balancing HTTP/HTTPS applications and it uses layer 7 specific features, such as X-forwarder and sticky sessions. You can use strict layer 4 load balancing for applications that purely rely on the TCP protocol.
    • Classic load balancer error 504, if your application throws error code 504 (Gateway Timeout). This means the application may have issues at the application layer or database layer.
  • X-Forwarded-For – This helps to identify the public IP address under the private cluster. This is part of the classic Load balancer. ELB can pass the public IPv4 address of the client to the EC2 instance.

  • Notes:
    • Load balancers do not provide any public IP address; instead, they will have a DNS name. You will need to update the DNS in cname instead of IP address.
    • Instances monitored on the ELB are reported as
      • In-service
      • Out-service
    • Health checks verify if the instance is healthy by talking to them.