AWS Elastic Load Balancer和多个可用性区域 [英] AWS Elastic Load Balancer and multiple availability zones

查看:275
本文介绍了AWS Elastic Load Balancer和多个可用性区域的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想了解ELB在多个 可用区 之间的负载平衡.例如,如果我在ELB后面的区域us-east-1a中有4个实例(a1, a2, a3, a4),在us-east-1d中有一个实例d1,那么如何在两个可用区域之间分配流量?即d1是否会获得全部流量的近50%或1/5th的流量?

I want to understand how ELB load balances between multiple availability zones. For example, if I have 4 instances (a1, a2, a3, a4) in zone us-east-1a and a single instance d1 in us-east-1d behind an ELB, how is the traffic distributed between the two availability zones? i.e., would d1 get nearly 50% of all the traffic or 1/5th of the traffic?

推荐答案

如果启用ELB

If you enable ELB Cross-Zone Load Balancing, d1 will get 20% of the traffic.

在未启用跨区域负载平衡的情况下会发生以下情况: D1将获得近50%的流量.这就是为什么Amazon建议从每个可用区向您的ELB添加相同数量的实例.

Here's what happen without enabling Cross-Zone Load Balancing: D1 would get nearly 50% of the traffic. This is why Amazon recommends adding the same amount of instances from each AZ to your ELB.

以下摘录摘自 Elastic Load Balancing概述:

传入流量在为负载均衡器启用的所有可用区域之间均等地进行负载均衡,因此在每个区域中拥有大约相等数量的实例非常重要.例如,如果您在可用区us-east-1a中有十个实例,在us-east-1b中有两个实例,则流量仍将在两个可用区之间平均分配.结果,us-east-1b中的两个实例将必须提供与us-east-1a中的十个实例相同的流量.作为最佳实践,我们建议您在每个可用区中保留相等或几乎相等数量的实例.因此,在该示例中,您可以分配实例,以使每个可用区中有六个实例,而不是在us-east-1a中有10个实例,在us-east-1b中有两个实例.

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.

这篇关于AWS Elastic Load Balancer和多个可用性区域的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆