Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How Amazon ELB will distribute requests to Amazon EC2 instances of different instance types?

Anyone has any idea how the ELB will distribute requests if I register multiple EC2 instances of different sizes. Say one m1.medium, one m1.large and one m1.xlarge.

Will it be different if I register EC2 instances of same size? If so then how?

like image 514
Naveed Avatar asked Apr 03 '13 13:04

Naveed


1 Answers

That's a fairly complicated topic, mostly due to the Amazon ELB routing documentation falling short of being non existent, so one needs to assemble some pieces to draw a conclusion - see my answer to the related question Can Elastic Load Balancers correctly distribute traffic to different size instances for a detailed analysis including all the references I'm aware of.

For the question at hand I think it boils down to the somewhat vague AWS team response from 2009 to ELB Strategy:

ELB loosely keeps track of how many requests (or connections in the case of TCP) are outstanding at each instance. It does not monitor resource usage (such as CPU or memory) at each instance. ELB currently will round-robin amongst those instances that it believes has the fewest outstanding requests. [emphasis mine]

Depending on your application architecture and request variety, larger Amazon EC2 instance types might be able to serve requests faster, thus have less outstanding requests and receive more traffic accordingly, but either way the ELB supposedly distributes traffic appropriately on average, i.e. should implicitly account for the uneven instance characteristics to some extent - I haven't tried this myself though and would recommend both, Monitoring Your Load Balancer Using CloudWatch as well as monitoring your individual EC2 instances and correlate the results in order to gain respective insight and confidence into such a setup eventually.

like image 98
Steffen Opel Avatar answered Oct 14 '22 20:10

Steffen Opel