Azure auto-scale at specific times

1.8k Views Asked by At

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).

1

There are 1 best solutions below

0
On

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.