Search code examples
c#azureconcurrencyscalabilityazure-web-roles

How to scale effectively in windows azure?


I have been having some difficulties in identifying the right configurations for effectively scaling my cloud service. I am assuming we just have to use the scale section of the management portal and nothing programmatically? My current configuration for Web Role is

Medium sized VM (4 GB RAM) Autoscale - CPUInstance Range - 1 to 10Target CPU - 50 to 80Scale up and down by 1 instance at a timeScale up and down wait time - 5 mins

I used http://loader.io/ site to do load testing by sending concurrent requests to an API. And it could support only 50 -100 users. After that I was getting timeout(10 secs) errors. My app will be targeting millions of users on a huge scale, so am not really sure how I can efficiently scale to cater to that much load on the server.

I think the problem could be the scale up time which is 5mins(i think its very high), and in management portal, the lowest option is 5mins, so dunno how i can reduce it?

Any suggestions?


Solution

  • Azure's auto-scaling engine examines 60-minute cpu-utilization averages every 5 minutes. This means that every 5 minutes it has a chance to decide if your CPU utilization is too high and scale you up.

    If you need something more robust, I'd recommend to think about the following:

    • CPU Usage is rarely a good indicator for scaling of websites. Look into Requests/sec or requests/current instead of CPU utilization.
    • Consider examining the need to scale more frequently (every 1 min?) Azure portal cannot do this. You'll need either WASABi or AzureWatch for this
    • Depending on your usage patterns, consider looking at shorter time averages to make a decision (ie: average over 20 minutes not 60 minutes). Once again, your choices here are WASABi or AzureWatch
    • Consider looking at the /rate/ of increase in the metrics and not just the latest averages themselves. IE: requests/sec rose by 20% in the last 20 minutes. Once again, Azure autoscaling engine cannot do this, consider either WASABi (which may do this) or AzureWatch which definitely can do this.

    WASABi is an application block from Microsoft (ie: a DLL) that you'll need to configure, host and monitor somewhere yourself. It is pretty flexible and you can override whatever functionality since it is open source.

    AzureWatch is a third-party managed service that monitors/autoscales/heals your Azure roles/Virtual Machines/Websites/SQL Azure/etc. It costs money but you let someone else do all the dirty work.

    I recently wrote a blog about the comparison of the three products

    Disclosure: I'm affiliated with AzureWatch

    HTH