What algorithm does Amazon ELB use to balance load?
Solution 1:
It's request count based for HTTP(S), round robin for other.
http://docs.aws.amazon.com/ElasticLoadBalancing/latest/DeveloperGuide/TerminologyandKeyConcepts.html#request-routing
Before a client sends a request to your load balancer, it first resolves the load balancer's domain name with the Domain Name System (DNS) servers. The DNS server uses DNS round robin to determine which load balancer node in a specific Availability Zone will receive the request.
The selected load balancer node then sends the request to healthy instances within the same Availability Zone. To determine the healthy instances, the load balancer node uses either the round robin (for TCP connections) or the least outstanding request (for HTTP/HTTPS connections) routing algorithm. The least outstanding request routing algorithm favors back-end instances with the fewest connections or outstanding requests.
Solution 2:
It depends on the type of ELB used. AWS has over the time introduced Application ELB and Network ELB along with the Classic ELB.
Application Load Balancers
applies listener rules and assigns the (HTTP/HTTPS) request to a target group. It selects a target from that target group using the round robin routing algorithm
Network Load Balancers
node that receives the connection, selects a target from its target group using a flow hash routing algorithm
Classic Load Balancers
uses round robin routing algorithm
for TCP listeners and least outstanding requests routing algorithm
for HTTP and HTTPS listeners
.
TLDR;
The modern ELBs use
round robin routing algorithm
for HTTP/HTTPS requests andflow hash routing algorithm
for TCP requests.Classic ELB used
round robin routing algorithm
for TCP requests andleast outstanding requests routing algorithm
for HTTP and HTTPS requests
Source / Further Reading : https://docs.aws.amazon.com/elasticloadbalancing/latest/userguide/how-elastic-load-balancing-works.html#routing-algorithm