I am running a load test against my Azure Web App P3 pricing tier. We have the following auto scale out strategy -
Min Instance 5 and Max instance 20, Increase by 1 Instance if CPU Percentage (Max) goes more than 85%, Decrease by 1 Instance if CPU Percentage Average goes below than 50%
Right now, it is running with 5 instances. If I go to Applications Insights, 'Live Metrics Stream' pane of all available instances, it shows that CPU usage is around 75% (average) in all the 5 instances. In fact, some of the instances are nearing 85%.
Whereas, if I turn to CPU usage chart on the App Service Plan level (I have only one app running under the plan), it shows only 20%.
How do we reconcile these two conflicting stats?
According to your description, I tried to run the load test against my Azure Web App. Here are the detailed metrics from Application Insights and App Service Plan, you could refer to it.
Application Insight > Metrics Explorer
App Service Plan > Monitoring
Note: Since the Live Metrics Stream provides you the metrics within the latest 60 seconds. Please try to compare the metrics from App Service Plan and Application Insights within the same Time range.
Per my understanding, the trend of metrics from Service Plan and Application Insights is approximately the same. For auto-scaling, I assumed that you'd better refer to the metrics from the App Service Plan level. Here is a screenshot about the history metrics when you adding the rule for auto-scaling, which matches the metrics from "App Service Plan > Monitoring" with the same time range.
Metrics when adding the scale rule:
App Service Plan > Monitoring