Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

I want to load balance my azure website

I have my website (abc.azurewebsites.net) hosted to Azure Web Apps using Visual Studio.

Now after 1 month I am facing problems with traffic management. My CPU is always 90 - 95% as the number of requests is too high.

Does anyone know how to add Traffic Management in this web app without changing the domain abc.azurewebsites.net? Is it hard coded in my application?

I thought of changing the web app to a Virtual Machine but now as it's already deployed I am scared of domain loss.

like image 771
Ramesh Bhuva Avatar asked Dec 17 '15 16:12

Ramesh Bhuva


People also ask

How do I load a virtual machine balance?

Connect to your cluster and go to Tools > Settings. Under Settings, select Virtual machine load balancing. Under Balance virtual machines, select Always to load balance upon server join and every 30 minutes, Server joins to load balance only upon server joins, or Never to disable the VM load balancing feature.


Video Answer


2 Answers

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.

I can vouch that my company is using Azure Web Apps to manage more than 1000 concurrent users making thousands of requests with just 2-3 instances. It all depends on what your application does and what other resources does it access too, if you implemented or not a caching strategy and what kind of data storage you are using.

High CPU does not always mean high traffic, it's a mix of CPU and Http Queue Length that gives you an idea of how well your instances are handling traffic.

Your solution might implementing a group of things:

  • Performance tweak your application
  • Add caching strategies (distributed cache like Azure Redis is a good option)
  • Increase Web App instances by configuring Auto-Scaling based on HTTP Queue Length / CPU.
like image 190
Matias Quaranta Avatar answered Nov 09 '22 11:11

Matias Quaranta


You should not have to change your domain to autoscale a Web App, but you may have to change your pricing tier. Scaling to multiple instance is available at Basic pricing tier, and autoscaling starts at Standard tier. Custom domains are allowed at these levels but you don't have to change your domain if you don't want to.

Here is the overview of scaling a web app https://azure.microsoft.com/en-us/documentation/articles/web-sites-scale/

like image 41
Amanda Lange Avatar answered Nov 09 '22 11:11

Amanda Lange