Search code examples
azureautoscaling

Azure app plan autoscaling - confused by "default" settings


I want to configure autoscaling on an app service plan, which is currently hosting a web app.

I created my scale in and scale out rules. At the bottom of the page there is a setting for "minimum", "maximum" and "default", which I configured as "1", "15" and "2".

From my understanding, the "default" value should be used only if metrics can't be retrieved.

My scale in rule is set to remove one instance if the memory usage is below 30%, which triggers as expected if the number of instances is greater or equals than 2; but it never triggers after that - unless I set the "default" value to be 1 as well.

I don't understand this behaviour, why does this happen?

Thanks a lot!


Solution

  • the "default" value should be used only if metrics can't be retrieved..
    
    

    It is not specifically used only if metrics can’t be retrieved. When no other profile matches the current time or metric conditions, the auto scale settings’ “default” value is applied.

    • It can be configured with specific rules for scaling based on metrics such as CPU usage or memory usage. If no maximum or minimum instance counts are specified, your workload will be scaled based on the default instance count you choose, so it is crucial to choose one that is safe for it. An auto scale job always reads the associated metric to scale by, regardless of whether a default profile is used or not.
      Refer this Auto scaling MS document.
      enter image description here
    but it never triggers after that...and I don't understand this behaviour, why does this happen?
    
    

    it could be because the memory usage of the remaining instances is above 30%.

    • Autoscaling rules are evaluated based on the current resource utilization of all instances. The scale-in rule won’t be activated if the remaining instance(s) are using more memory than 30%. In this situation, you might need to modify your scaling rule or take additional factors like CPU use or requests per second into account when choosing your scaling strategy.
      Refer this MS document it may helps.
    • Once check if there are any other rules that may be overriding your scale in rule. For example, if you have a scale out rule that triggers when CPU usage exceeds a certain threshold, it may add additional instances even if memory usage is low.