亚马逊ec2 – AWS弹性负载平衡器和多个可用区域

我想了解ELB在多个可用区域之间的负载平衡.例如,如果我们在区域us-east-1a中有4个实例(a1,a2,a3,a4),在ELB之后的us-east-1d中有一个实例d1,那么两个可用区域之间的流量如何分配?即,d1会接收到所有流量的近50%或流量的1/5?
最佳答案
如果启用ELB Cross-Zone Load Balancing,则d1将获得20%的流量.

没有启用跨区域负载平衡的情况下会发生什么:
D1将获得近50%的流量.这就是为什么亚马逊建议从每个AZ添加相同数量的实例到您的ELB.

以下摘录摘自Overview of Elastic Load Balancing

Incoming traffic is load balanced equally across all Availability Zones enabled for your load balancer, so it is important to have approximately equivalent numbers of instances in each zone. For example, if you have ten instances in Availability Zone us-east-1a and two instances in us-east-1b, the traffic will still be equally distributed between the two Availability Zones. As a result, the two instances in us-east-1b will have to serve the same amount of traffic as the ten instances in us-east-1a. As a best practice, we recommend you keep an equivalent or nearly equivalent number of instances in each of your Availability Zones. So in the example, rather than having ten instances in us-east-1a and two in us-east-1b, you could distribute your instances so that you have six instances in each Availability Zone.

转载注明原文:亚马逊ec2 – AWS弹性负载平衡器和多个可用区域 - 代码日志