0

I've a Amazon ELB behind which there are 3 EC2 instances distributed across 3 zones.

Following are extracts of access logs on each instances:

1st instance(Zone A):

10.210.214.231 - - [17/Sep/2011:15:40:16 -0400] "GET /healthcheck.html HTTP/1.1" 200 194 "-" "ELB-HealthChecker/1.0"
10.223.33.43 - - [17/Sep/2011:15:40:16 -0400] "GET /healthcheck.html HTTP/1.1" 200 194 "-" "ELB-HealthChecker/1.0"
10.210.214.231 - - [17/Sep/2011:15:40:17 -0400] "GET /healthcheck.html HTTP/1.1" 200 194 "-" "ELB-HealthChecker/1.0"
10.223.33.43 - - [17/Sep/2011:15:40:17 -0400] "GET /healthcheck.html HTTP/1.1" 200 194 "-" "ELB-HealthChecker/1.0"

2nd instance(Zone C):

10.116.114.11 - - [17/Sep/2011:15:40:16 -0400] "GET /healthcheck.html HTTP/1.1" 200 194 "-" "ELB-HealthChecker/1.0"
10.116.114.11 - - [17/Sep/2011:15:40:16 -0400] "GET /healthcheck.html HTTP/1.1" 200 194 "-" "ELB-HealthChecker/1.0"

3rd instance(Zone D):

10.223.33.43 - - [17/Sep/2011:15:40:16 -0400] "GET /healthcheck.html HTTP/1.1" 200 194 "-" "ELB-HealthChecker/1.0"
10.223.33.43 - - [17/Sep/2011:15:40:16 -0400] "GET /healthcheck.html HTTP/1.1" 200 194 "-" "ELB-HealthChecker/1.0"

Eager to know how come traffic is coming from separate IP's on instances behind same ELB. Also, 10.223.33.43 is showing up on two of instances. Why is that so?

Do LB's exist in each zone where an instance is launched? Sounds weird, but having separate IP's in access logs make me believe it..

aamod
  • 3
  • 2

1 Answers1

2

ELBs appear to work in a way that is somewhat counter-intuitive (at least at first glance), in order to maintain scalability and prevent a single point of failure.

I think that the first impression one gets of an ELB is that it is a single regular instance setup with some load balancing software that sits in front of your application instances and distributes the traffic - my recent reading suggests that this is quite far from reality.

It appears that each availability zone has one (or more) load balancers to serve your instances in that zone. You will have setup a CNAME to point to the ELB - a virtual entity - AWS' internal DNS will map this to one of the load balancers assigned to you. That load balancer will then determine where to send the client request - whether it is to an instance in the same availability zone or to another availability zone. Additionally, more load balancers will be added in order to scale your applications needs, and AWS does this in 'anticipation' of increased traffic.

Therefore, it is hypothetically possible to have 2 or more load balancers per availability zone despite only having launched a single ELB, if their is sufficient traffic going to your application.

If you glance at the ELB Developer Guide (around page 9) you will find a mention of the idea that a request can be passed from one load balancer to another. (In the particular example given, it refers to multiple X-Forwarded-For headers, including those of ELBs).

If you have back-end application instances in multiple Availability Zones, the X-Forwarded-For request header can contain one or more load balancer IP addresses. Because Elastic Load Balancing uses a different load balancer for each Availability Zone, a client request can be passed from one load balancer to another before reaching a back-end application instance. For example, if you have back-end instances in Availability Zones US-east-1a and US-east-1b, a client request might be handled initially by the load balancer in US-east-1a. If Elastic Load Balancing determines that this request should be routed to US-east-1b, the load balancer in US-east-1a routes the request to the load balancer in US-east-1b.

Hopefully that addresses how you have multiple load balancer addresses as well as how the same address may show up in different availability zones.

I would suggest looking at The “Elastic” in “Elastic Load Balancing”: ELB Elasticity and How to Test it as a good overview of how ELBs work.

cyberx86
  • 20,620
  • 1
  • 60
  • 80