简体   繁体   中英

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.

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.

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/

Adding a Virtual Machine (VM) is very costly as compared to adding instance. On top of it, Redundancy (recommended) for the VMs, adding NIC etc will blow up the cost. Maintenance is another challenge. PAAS (webApp etc) is always a better option than IAAS. Serverless offerings like Azure Functions can also be thought of. They support http trigger and scale up really well.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM