2

We would like to set up Azure auto-scaling based on specific time of the day. E.g. on 7:00 we would like to increase number of instances and at 17:00 we would like to decrease them.

We are aware that we can set to scale up by some other metrics (CPU, number of messages in queue, etc.), but this has some negative impacts for us - starting of a new instance takes some time and also w3wp warm-up takes some time too. And we need to have instances ready immediately when high load comes.

Is there any way to set auto-scaling on specific time of the day (from 7:00 to 17:00) and specific days of week (working days).

michal.jakubeczy
  • 8,221
  • 1
  • 59
  • 63
  • The VMSS auto-scales vm by creating new VMs with the image, not just start them. So auto-scale may take some time. I suggest you can start i auto-scale earlier . – Wayne Yang Dec 27 '17 at 09:39
  • @WayneYang-MSFT: thanks, yeah, I know this. We can obviously set our auto-scale metrics to be more strict, e.g. when few messages come to queue (the first ones in the morning) we scale up and we do not scale down until something's in the queue, but this seems to be a bit hacky for me - i found more cleaner to say at 7:00 put 3 instances, at 17:00 go back to 2. of course it is not so flexible, but instances are always ready at business hours – michal.jakubeczy Dec 27 '17 at 09:41
  • @WayneYang-MSFT: does Azure offer such mechanism or is there some scheduled task which I can code and accomplish this? – michal.jakubeczy Dec 27 '17 at 09:43
  • Azure has many automation and scheduler tools: https://learn.microsoft.com/en-us/azure/automation/automation-intro But I'm afraid that they may not be suitable for your scenario. – Wayne Yang Dec 27 '17 at 09:47
  • thanks. is there anything on your backlog to enhance auto-scaling this way in the future? – michal.jakubeczy Dec 27 '17 at 10:00
  • 1
    Yes, we realize it's very important to customers . I will report this to Azure PG. Actually, IaaS cannot achieve this for now. But we will pay attention to this , and may supply another way to achieve that. – Wayne Yang Dec 27 '17 at 10:08

1 Answers1

3

You could inculcate the following general guidelines based on your requirement:

Scale based on a schedule

In addition to scale based on CPU, you can set your scale differently for specific days of the week.

  1. Click Add a scale condition.
  2. Setting the scale mode and the rules is the same as the default condition.
  3. Select Repeat specific days for the schedule.
  4. Select the days and the start/end time for when the scale condition should be applied.

Scale differently on specific dates

In addition to scale based on CPU, you can set your scale differently for specific dates.

  1. Click Add a scale condition.
  2. Setting the scale mode and the rules is the same as the default condition.
  3. Select Specify start/end dates for the schedule.
  4. Select the start/end dates and the start/end time for when the scale condition should be applied.

Refer Get started with Autoscale in Azure for more details.

As general Autoscaling guidelines: When you can predict the load on the application well enough to use scheduled autoscaling, adding and removing instances to meet anticipated peaks in demand. If this isn't possible, use reactive autoscaling based on runtime metrics, in order to handle unpredictable changes in demand. Typically, you can combine these approaches. For example, create a strategy that adds resources based on a schedule of the times when you know the application is most busy. This helps to ensure that capacity is available when required, without any delay from starting new instances. For each scheduled rule, define metrics that allow reactive autoscaling during that period to ensure that the application can handle sustained but unpredictable peaks in demand.

AjayKumar
  • 2,812
  • 1
  • 9
  • 28