How does AWS Elastic Load Balancer distribute traffic?

How does AWS Elastic Load Balancer distribute traffic?
5 min read

Introduction of AWS Elastic load balancer (ELB).

Elastic Load Balancer is a managed service provided by Amazon Web Services. It helps to distribute incoming traffic from applications across multiple targets such as Amazon EC2 instance, containers, IP address, and Lambda function. ELB provides high availability, fault tolerability, and scalability, allowing applications to handle different levels of traffic with no manual intervention. This article will explore the AWS ELB's workings and the techniques it uses to efficiently distribute traffic. AWS Classes in Pune

Algorithms for Load Balancing

AWS Elastic Load Balancing uses different load-balancing algorithms in order to distribute traffic efficiently. The type of load balancer chosen and its configuration will determine the algorithm to be used. AWS ELB uses the following primary load-balancing algorithms:

  1. Round Robin : This is the easiest load-balancing algorithm where traffic is evenly distributed across all targets registered. The circular pattern is created by sending each new request to the next target on the list. This method is effective when all targets are of similar computing capability and performance.

  2. Least connections : This algorithm directs traffic incoming to the target that has the fewest active connection. ELB counts the number of active connections for each target and directs new requests towards the target with the fewest. This is a great approach when targets are of varying capacity, because it evenly distributes the load according to actual resource usage.

  3. IP Hash : The IP Hash algorithm utilizes the source IP address to determine the target to which the request should be sent. So, all requests coming from the same source IP address will be directed to the exact same destination. This is useful for applications that depend on session affinity, or maintain stateful connections.

  4. Application Based Routing This algorithm operates at Layer 7 of the OSI Model and is used in conjunction with the Application Load Balancer. It can route based on the HTTP/HTTPS requests attributes, including the hostname, the path, the headers or the query strings. It allows for advanced routing scenarios such as routing requests to target groups based solely on the request content. AWS Course in Pune

  5. Network Based Routing is used in conjunction with the Network Load Balancer and runs at Layer 4 (Transport) of the OSI Model. It forwards traffic using IP protocol information, such as source IP address and destination IP address. TCP/UDP ports are also used. It is therefore more suitable for applications which rely on TCP/UDP connections and for those with extreme performance requirements.

Session stickiness

In certain cases, maintaining session affinity (or "stickiness") is crucial when distributing traffic. This ensures that all requests sent by the same client will be consistently sent to the target. This is particularly important when dealing with applications that require the session information to be maintained across multiple requests.

AWS Elastic Load Balancing supports session stickiness. Users can enable this feature while creating a target group. ELB associates a user session with a target when session stickiness is enabled. The user's subsequent requests are directed to the target in order to maintain session continuity.

Auto Scaling and Health Checks

ELB constantly monitors the health status of targets registered to ensure that traffic only goes to operational and healthy instances. This is done by sending periodic health checks to targets to assess their health status. ELB will not send traffic to a target that fails a health test until it passes again.

Elastic Load Balancing and Amazon EC2 auto scaling work together to improve the scalability of your system. EC2 Auto Scaling adjusts the number running instances based upon predefined policies. When Auto Scaling adds or removes instances, ELB automatically detects and registers/deregisters the instances from the load balancer, seamlessly adapting to changes in the application's demand. AWS Training in Pune


AWS Elastic load balancer is a key component in ensuring that applications hosted by Amazon Web Services are highly available, fault-tolerant, and scalable. It helps users enjoy a smooth and responsive experience by distributing traffic among multiple targets efficiently using different load balancing algorithm. ELB is a robust solution that can handle varying traffic levels and maintain application stability. It has additional features such as session stickiness and health checks. Elastic Load Balancer's capabilities are expected to grow as AWS develops its services. This will enhance the performance and reliability for modern web applications.

In case you have found a mistake in the text, please send a message to the author by selecting the mistake and pressing Ctrl-Enter.
Comments (0)

    No comments yet

You must be logged in to comment.

Sign In / Sign Up