AWS: Elastic Load Balancing

AWS: Elastic Load Balancing

"Alone we can do so little; together we can do so much." – Helen Keller

A load balancer takes incoming traffic from clients and routes requests to one or more Availability Zones' registered targets (such as EC2 instances). The load balancer also keeps track of the health of its registered targets, ensuring that only healthy targets receive traffic. When the load balancer detects an unhealthy target, traffic is diverted away from it. When it determines that the target is healthy again, it resumes directing traffic to it.

One or more listeners are used to setup your load balancer to receive incoming traffic. A connection request listener is a process that monitors for connection requests. For connections from clients to the load balancer, it is configured with a protocol and port number. For connections from the load balancer to the targets, it is also configured with a protocol and port number.

You can use any of the following interfaces to create, access, and administer your load balancers:

  • AWS Management Console
  • AWS Command Line Interface (AWS CLI)
  • AWS SDKs
  • Query API

The following load balancers are supported by Elastic Load Balancing:

  • Application Load Balancers: An Application Load Balancer makes application-layer routing decisions (HTTP/HTTPS), supports path-based routing, and can route requests to one or more ports on each container instance in your cluster. Dynamic host port mapping is supported.
  • Network Load Balancers: At the transport layer (TCP/SSL), a Network Load Balancer determines routing decisions. It is capable of processing millions of requests per second. Dynamic host port mapping is supported.
  • Gateway Load Balancers: Gateway Load Balancers let you create, scale, and manage virtual appliances, including firewalls, intrusion detection and prevention systems, and deep packet inspection systems. It combines a transparent network gateway with traffic distribution while growing your virtual appliances in response to demand. It operates at the network layer, the third layer of the OSI architecture.
  • Classic Load Balancers: Classic Load Balancers perform routing decisions at the transport layer (TCP/SSL) or the application layer (HTTP/HTTPS). They presently demand that the load balancer port and the container instance port have a fixed relationship.

The configuration of the load balancer types differs significantly. You register targets in target groups and route traffic to them using Application Load Balancers, Network Load Balancers, and Gateway Load Balancers. You register instances with the load balancer with Classic Load Balancers.

Routing algorithm

The load balancer node that receives the request while using Application Load Balancers goes through the following steps:

  1. To choose which rule to apply, it evaluates the listener rules in priority order.
  2. Using the routing algorithm set for the target group, it selects a target from the target group for the rule action. Round robin is the default routing algorithm. Even when a target is registered with multiple target groups, routing is done independently for each target group.

The load balancer node that receives the connection uses the following process when using Network Load Balancers:

  1. Using a flow hash algorithm, it chooses a target from the target group for the default rule. The protocol, source IP address and source port, destination IP address and destination port, and TCP sequence number are all used in the algorithm.
  2. It routes each individual TCP connection to a single destination for the duration of the connection. Client TCP connections can be directed to many targets and have varying source ports and sequence numbers.

When using Classic Load Balancers, the load balancer node that receives the request chooses a registered instance in the following manner:

  • For TCP listeners, the round-robin routing mechanism is used. For HTTP and HTTPS listeners, the least outstanding requests routing algorithm is used.

To view or add a comment, sign in

More articles by Evans Kiprotich

  • AWS IAM: Users, Groups, Policies, and Roles

    Identity and Access Management (IAM) is a crucial component of security in the Amazon Web Services (AWS) platform. It…

  • AWS RDS Service Provisioned Storage: Keeping it Free Tier

    As a final year engineering student, I was working on a project that required a lot of data storage using AWS RDS…

  • Python for Web Development

    "The first step towards getting somewhere is to decide that you are not going to stay where you are." ~ Chauncey Depew…

  • Learning JavaScript Data Types & Variables

    “Anyone who stops learning is old, whether at twenty or eighty.” ~ Henry Ford I discovered a program offered by ALX in…

    7 Comments
  • Python 101 : The Ultimate Python Tutorial For Beginners

    "Sometimes it's more about the journey than the destination." ~ Jamal Crawford Back in high school, while working on a…

    11 Comments

Insights from the community

Others also viewed

Explore topics