Search code examples
azureazure-web-app-serviceload-balancingazure-app-service-plansazure-load-balancer

How does Azure split requests across App Service instances?


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?


Solution

  • 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.