1
votes

I have developed a queue triggered azure function in c#. The function is running on the AppService plan. We want to implement custom auto-scale out. We are planning to increases the instance count by 1 when the CPU percentage is above 60%

My questions are:

  1. Is this a good idea to increase the instance count at 60%?
  2. I have research and found that for blob triggered azure function there is a mechanism that will prevent two instances to pick the same queue entry. Its there the same mechanism for C# Queue Triggered Azure Function?
  3. In my function code, I have written Thread.Sleep(3000) to sleep the thread in some conditions. Can it cause any issue while scaling out?
  4. Is there anything else I should keep in mind while scaling out in my scenario?

Thanks in advance.

1

1 Answers

1
votes

Is this a good idea to increase the instance count at 60%?

We recommend choosing an adequate margin between the scale-out and in thresholds. As an example, consider the following better rule combination.

  • Increase instances by 1 count when CPU% >= 80
  • Decrease instances by 1 count when CPU% <= 60

I have research and found that for blob triggered azure function there is a mechanism that will prevent two instances to pick the same queue entry. Its there the same mechanism for C# Queue Triggered Azure Function?

Yes, don't worry about this.

In my function code, I have written Thread.Sleep(3000) to sleep the thread in some conditions. Can it cause any issue while scaling out?

No.

Is there anything else I should keep in mind while scaling out in my scenario?

All the webapps, functionapps under this app service plan will consume the resources, there are also some other metrics you can consider, such as memory usage.