amazon-web-services – AWS是否支持加权负载平衡?

AWS本身是否支持加权负载平衡?

从我看来,ELB仅支持循环负载平衡(没有任何可配置的权重).但是我还没有找到可靠的文档.

我能想到的最简单的事情就是在它前面放置一个像Nginx这样的负载均衡器,例如:

upstream backend  {
  server backend1.example.com weight=1;
  server backend2.example.com weight=2;
  server backend3.example.com weight=4;
}

在这里,七个请求中,一个将转到backend1,两个转到backend2,另外四个转到backend4.

它会工作,但它也意味着你必须为此设置一个Nginx服务器.如果AWS将直接支持加权负载平衡,那将更容易设置.

最佳答案
How Elastic Load Balancing Works文档页面指出:

With a Classic Load Balancer, the load balancer node that receives the request selects a registered instance using the round robin routing algorithm for TCP listeners and the least outstanding requests routing algorithm for HTTP and HTTPS listeners.

With an Application Load Balancer, the load balancer node that receives the request evaluates the listener rules in priority order to determine which rule to apply, and then selects a target from the target group for the rule action using the round robin routing algorithm. Routing is performed independently for each target group, even when a target is registered with multiple target groups.

Elastic Load平衡服务不支持加权循环(您指定权重).

您可以将Amazon Route 53与加权路由策略配合使用.从Choosing a Routing Policy文档页面:

Use the weighted routing policy when you have multiple resources that perform the same function (for example, web servers that serve the same website) and you want Amazon Route 53 to route traffic to those resources in proportions that you specify (for example, one quarter to one server and three quarters to the other).

转载注明原文:amazon-web-services – AWS是否支持加权负载平衡? - 代码日志