Azure如何在App Service实例之间分配请求?

huangapple go评论64阅读模式
英文:

How does Azure split requests across App Service instances?

问题

在Azure中,我有一个App Service,具体来说是一个FastApi解决方案,我已经手动扩展到3个实例。我进行了一些测试,以了解请求是如何分布到这些实例的,令人惊讶的是它似乎不是循环负载均衡。大多数请求似乎分配给第一个实例,大约50-60%,其余的则分配给其他两个实例。是否有任何设置可以配置以实现循环负载均衡?

英文:

I have an App Service in Azure, specifically a FastApi solution that i have manually scaled up to 3 instances. I did some testing to see how requests are spread across those instances and was surprised to see that it doesn't appear to be round robin. It seems that the most of the requests perhaps 50-60% go to the first instance and the rest are spread to the other two.
Is there any setting that can be configured to allow requests to be shared in a round robin fashion?

答案1

得分: 1

不,这是一个托管解决方案。没有旋钮可供调整。根据文档,它使用循环算法:

前端是一个第七层负载均衡器,充当代理,将传入的HTTP请求分发给不同的应用程序和它们各自的工作程序。目前,App Service的负载平衡算法是为给定应用程序分配的一组服务器之间的简单循环。

(尽管这是一个旧文档,但根据这个答案来自微软员工的说法,它似乎仍然有效。)

请注意,如果在相同计划上有其他应用程序,它们可能会收到流量,因此在调查负载分发时,如果您已经放大到特定的Web应用程序,可能无法看到整个图片。

英文:

No, it is a managed solution. No knobs to turn. According to the docs it uses a round robin algorithm:

> The front end is a layer seven-load balancer, acting as a proxy, distributing incoming HTTP requests between different applications and their respective Workers. Currently, the App Service load-balancing algorithm is a simple round robin between a set of servers allocated for a given application.

(Although it is an old document it seems to be regarded as still actual given this answer by a Microsoft employee.)

Do mind that if there are other apps on the same plan they may receive traffic so you might nog see the whole picture if you have zoomed in to a specific web app when you investigated the load distribution.

huangapple
  • 本文由 发表于 2023年3月15日 20:52:02
  • 转载请务必保留本文链接:https://go.coder-hub.com/75744978.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定