Possible to set Azure load balancing affinity method for App Services? - azure

I know that you can set the type of load balancer affinity used for Azure VM's, as described here:
https://azure.microsoft.com/en-us/documentation/articles/load-balancer-distribution-mode/
Is it possible to do the same with Azure App Services (formerly websites)? Basically, I want to use the "none" algorithm because the load testing I'm doing is all coming from the same IP. I can see from logging that all requests end up being routed to the same instance, which is not particularly useful for a load test. :)

Affinity is On by default which means the load balancer will keep the user to the same instance during his session. All you have to do is switch it off.

Related

How Azure load balances scaled out App Service plan?

I have one Azure App Service in which I have created 5 instances using App Service Plan
Scale Out option. Now I am not sure how does Azure load balances requests between this instances? I am not seeing any load balancer for it.
Also how can I know that which request is being served by which instance?
The load balancer is created automatically and you can't see it.
Basically it sends the requests to instances at random, though it can be made "sticky" with ARR Affinity.
You can find the setting in the App Service's Application Settings:
If it is on, the load balancer will attach a cookie to responses if they don't already have it.
It makes it so that future requests hit the same instance.
Though of course if the instance is no longer there (because of auto-scale for example), then it will again go to a random instance.
The WEBSITE_INSTANCE_ID environment variable can tell you in the back-end which instance is handling the request.
You can find a list of available variables here: https://github.com/projectkudu/kudu/wiki/Azure-runtime-environment

can we use load balancer on a two app services in azure

I am creating a network with 2 app services, containing 2 slots each
I know the load balancers are designed to work with VM's, but I am wondering if it is possible to place a load balencer on these 2 app services to balance the load between them, Is it possible to do so??
When you Scale your Web App you add instances of your current pricing tier and Azure deploys your Web App package to each of them.
There's a Load Balancer over all your instances, so, traffic is automatically load balanced between them. You shouldn't need a Virtual Machine for this and you don't need to configure any extra Traffic Manager.
You may want to refer: scale your app in Azure App Service for more details.
but I am wondering if it is possible to place a load balencer on
these 2 app services to balance the load between them, Is it possible
to do so??
According to your description, maybe you are looking for Azure application gateway(layer 7).
Azure application gateway works at the application layer (Layer 7 in the OSI network reference stack). It acts as a reverse-proxy service, terminating the client connection and forwarding requests to back-end endpoints.
Azure application gateway support HTTP, HTTPS and Websockets.
Here is the features offered by each service:
More information about Application gateway, please refer to this article.
Maybe little late but I guess this what you are looking at
Scale Out- A scale out operation is the equivalent of creating multiple copies of your web site and adding a load balancer to distribute the demand between them. When you scale out a web site in Windows Azure Web Sites there is no need to configure load balancing separately since this is already provided by the platform.
https://azure.microsoft.com/en-us/blog/scaling-up-and-scaling-out-in-windows-azure-web-sites/

Azure Webapps not failover when instance fails

We deployed a Node.js Azure Web App and defined a minimum of 2 instances (for scalability and high-availability).
It seems like the LB is balancing the load between the instances, but it doesn't react on instance error (crash) and seems to insist balancing the load between all the instances including the one which crashed.
Is there a way to set a fail-over mechanism for high-availability?
The load balancer used by Azure App Service will continue to send requests to individual web servers as long as the underlying virtual machines are up and running.
To workaround the issue you are running into, you can try configuring the "auto-heal" feature. If the scenario is that the app gets "stuck" in a permanently broken state, auto-heal rules can be configured to automatically restart the app.
More details on auto-heal here:
Auto-heal for Azure Web Sites

Load balancing stateful web application

I am trying to scale a web app on Azure from a single web instance to multiple instances. The web app does a fair amount of processing of per-user state, it's also fairly interactive so latency is important. We currently have a single database, testing has shown it is not the bottleneck so for this question let's assume we don't have to worry about scaling it, all instances will hit the same database. In this case, I think per-user load balancing is the best option, as per-request will result in per-user state being duplicated in lots of web instances. Apart from the issue of maintaining consistency, I am concerned this would result in unacceptable latency for end users.
This link says that ARR does per-user load balancing by default on Azure. However, the Traffic Manager, which from what I can gather is automatically enabled when you spin up multiple web instances on Azure, does per-request load balancing.
So my question is, which of these two load balancing schemes will I be using if I add a few more instances to my Web Hosting Plan? If I need to manually disable the Traffic Manager, what is the best way to do this?
Calum - you can leverage the standard SQL Session State Provider in Azure or you could look at the Azure Redis Cache provider as well for backing stores for user session state.
When deploying to Cloud Service Web Roles you automatically get a load balancer instance in front of your hosts. It's relatively transparent other than configuration of Endpoints. Each newly added/removed auto-scaled instance gets added to the Cloud Service and is automatically added/removed to the load balancer.
As others have said, Azure Traffic Manager provides a higher level service which can direct traffic to multiple Azure Regions (data centers) and even on-premises endpoints.
A good overview of Load Balancing can be found here: http://azure.microsoft.com/blog/2014/04/08/microsoft-azure-load-balancing-services/

How to load balance azure website

Is it possible (and how) to load balance Azure web sites?
Situation is that I have a web site which I deployed to few redundant nodes. Now I would like to set up load balancing for reliability purposes.
I see that load balancing is done using Traffic Manager service which I tried to use, however Traffic Manager doesn't allow me to add a web site endpoint. It only allows me to add a custom virtual machine I have. On a side note, web sites are running in standard mode which means each runs on it's own VM which led me to believe I could load balance them.
I see people create separate VMs with Windows Server and use IIS ARR to perform actual web request load balancing. Is there a way in Azure to load balance web sites directly?
While converting over to web roles can very well suit your needs, an easier alternative may be to simply promote the web site up to the 'standard' tier, then increase the instance count. Windows Azure will then automatically handle load balancing the instances and even help ensure session affinity (which web roles can't do unless you jump through additional hoops).
Why not make your sites use Web Roles?
This only requires a very small change to the project to add a startup class.
These are automatically load balanced.
You are required to have at least two role instances to trigger the SLA.

Resources