question

NiharikaKoneru-8312 avatar image
0 Votes"
NiharikaKoneru-8312 asked ryanchill answered

How do web apps load balance with ARR affinity turned off?

For my Azure Web App I noticed in General Settings that my ARR affinity is set to “On” by default. I want to turn this setting off as the message states it improves performance of stateful apps, while my app is stateless. If I turn this setting off, how will it impact my application request routing? Will requests be routed randomly? Will they be evenly distributed?

82400-image.png


azure-webapps
image.png (858.7 KiB)
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

ryanchill avatar image
1 Vote"
ryanchill answered

When trying to Load Balance evenly between instances of a single Azure Web App, disabling ARR Affinity will accomplish this. As a PaaS service, each instance of the application is deployed with a load balancer over it.
More information on the Azure App Service architecture can be seen here, https://docs.microsoft.com/en-us/archive/msdn-magazine/2017/february/azure-inside-the-azure-app-service-architecture#:~:text=%20Inside%20the%20Azure%20App%20Service%20Architecture%20,acting%20as%20a%20proxy,%20distributing%20incoming...%20More

With that said, disabling ARR Affinity is a best practice to achieve highest uptime for your application. This will ensure that requests will be evenly distributed between instances and not overload a single instance.
More information on this and other best practices can be seen here, https://azure.github.io/AppService/2020/05/15/Robust-Apps-for-the-cloud.html#update-your-default-settings

Although ARR Affinity will help with distribution of traffic between instances, for distributing traffic between Deployment Slots or between different Web Apps requires a different solution.

For Deployment Slots, the percentage of traffic that you would like routed to each instance can be set from the Portal.

82532-image.png

For managing traffic between apps (for example, three apps deployed to different regions), a traffic manager offering would need to be used. Traffic managing offerings such as Azure Traffic Manager, Azure Application Gateway, or Azure FrontDoor can help in these multi-app scenarios.


image.png (19.1 KiB)
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.