1

Software engineer here, not a ton of experience managing servers, but wanting to understand how auto-scale works.

Here's the background:

We have a stateless application running on the azure cloud, which talks to an Azure SQL database behind the scenes. The database itself is geo-replicated across two different server regions.

We've setup auto-scale, such that, if server load exceeds 80%, we will scale out and add an instance. When the load drops back below 50%, we will scale back down. Scaling does not usually happen, but during periods of peak usage, the server will auto-scale.

Here's my question:

With auto-scale on, does azure automatically handle any load balancing between the instances? I understand that azure also has some load balancer products, but I'm trying to understand if we need them or not.

Without a load balancer explicitly setup, is scaling our instances pointless?

  • 1
    You probably do have to set up a load balancer and then your question becomes whether the new instances will be automatically in the balance set. Note that anything you need to be resilient at all should start with at least two VMs in an availability set and a load balancer with both/all VMs in the load balance set. – Todd Wilcox Nov 21 '17 at 21:51
  • Thanks @ToddWilcox - interested to hear other thoughts here. We're a non-profit, so running two VMs would double our operating costs for the web service. If possible, would like to only pay for multiple instances when we need to. – Scuba Steve Nov 21 '17 at 21:56
  • 1
    With one VM, there will be occasional downtime when Microsoft is doing updates or maintenance. I'm not sure if it's possible to determine when those downtimes will be ahead of time. If you're at a 501(c)3, Azure credits are available for free, direct from Microsoft: microsoft.com/en-us/nonprofits – Todd Wilcox Nov 21 '17 at 22:01
  • We're not an American org, we are a registered charity however, and we do have non-profit credits. They don't cover the entirety of our operating costs though. – Scuba Steve Nov 22 '17 at 18:58
1

If you are running a single instance of your webapp there is nothing to actually load balance. Hence, you would just setup scaling in the portal based on a particular metric. For example, if CPU % > 80% for X mins then Scale up to X instances. Then set another rule that states when CPU < 80% for X mins then scale down to X instances.

If you were to setup two instances and load balance them you would have to add a load balance on top of the instances. This is simple to do. Then from there you could also set the same monitoring rules.

https://docs.microsoft.com/en-us/azure/architecture/best-practices/auto-scaling

https://azure.microsoft.com/en-us/features/autoscale/

https://docs.microsoft.com/en-us/azure/monitoring-and-diagnostics/insights-autoscale-best-practices

  • Thanks for taking the time to write. So if I'm hearing this correctly, I only need to setup load-balancing if we need a custom solution - which I don't think we need. So, azure horizontal scaling will direct traffic for me? To clarify, we're using the 'application service', not actually managing our VMs. The former is a good-enough solution for us. When we do the horizontal scale, as needed, there exists more than once instance of the application, but only a single application service. – Scuba Steve Nov 28 '17 at 0:35
  • 1
    Correct. From what you have explained I see no need for you to add a load balancer and manually have additional instances. Rather I would just use what is build into the application service, the scaling service. You can decide if scaling out or scaling up (More power) or scaling out (More Instances) is right for you. Azure will take care of all the backend load balancing and what not for you. The cool thing about Azure and its app service is it is extremely easy to change it up so you can play around without worry of causing an issue :) – Micah_MSFT Nov 28 '17 at 18:48
  • Thanks Micah, that clears it up for me. And yes I agree, the Azure 'application service' is incredibly easy to manage. We have it hooked into our github, so we can push new revisions to prod with no downtime. It's pretty impressive how easy it is to manage these services. As long as we make sure the application is stateless, we can scale to n instances. – Scuba Steve Nov 28 '17 at 19:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.