I am using Azure Web app for hosting background jobs. I have Scale out plan to increase instance count by 1 if CPU or memory utilization goes above 85% and scale down if it is less than 65%. Now interesting part is that when my web app is on S2, web app goes to 10 instance while if I scale it up to S3, the instance count remains to 1 instance.
I am confused as it doesnt add up. If I keep my web app on S3, CPU and memory utilization remains below 50%.
Additional details
Job is subscriber to Azure Service bus. It keep watch on a service bus queue
Azure SDK - latest for dotnet core
Related
I have an 3 app servies running in an App Service plan in Azure. I am setting up a metric alert if the CPU % or Memeory usage on the App Service plan has reached a thresheold.
But I want to monitor each app service and the instances on each service as some have been scaled. The only mertric measure for CPU is CPU working set , but how does this monitor the CPU uage for the app service as the unit is in sec ?
After reproducing from my end, I could able to achieve your requirement while navigating to your App service >> Diagnose and solve problems >> Search for CPU Drill Down.
You can monitor other App Services as shown in the below image
I know that there is already some question around this. I am still confused about pricing.
My scenario is following
1 App Service Plan ( Standard s2 , 3.5 RAM , 50 GB size)
6 App Service belong to that plan.
Does it means that all 6 apps share 3.5 RAM and 50 GB storage or each app has 3.5 GB RAM and 50 GB ?
Also plan states that 10 instance auto scale. What does this actually mean ? Each app service scale at moment or each app service scale separately.
All 6 apps would share the same resources:
When you create an app in App Service, it is put into an App Service plan. When the app runs, it runs on all the VM instances configured in the App Service plan. If multiple apps are in the same App Service plan, they all share the same VM instances. If you have multiple deployment slots for an app, all deployment slots also run on the same VM instances. If you enable diagnostic logs, perform backups, or run WebJobs, they also use CPU cycles and memory on these VM instances.
As far as scaling that is done at the app service plan so again the scale will apply to all app services:
In this way, the App Service plan is the scale unit of the App Service apps. If the plan is configured to run five VM instances, then all apps in the plan run on all five instances. If the plan is configured for autoscaling, then all apps in the plan are scaled out together based on the autoscale settings.
Context: I am designing the auto-scaling (scale out) configuration for my .NET Framework 4.7 web app hosted on a Microsoft Azure App Service. I am using the P3V2 pricing tier. The application is CPU-bound. The app's 30 day CPU average is 30% usage while running on 2 instances, according to the stats indicated in the App Service plan. We occasionally have traffic spikes which will overwhelm the 2 instances: I want to implement auto-scaling.
I want to take into account the App Service Provisioning + App Startup Time when designing the metrics thresholds that decide when my app service scales out. I need to make my thresholds low enough to give Azure time to spin up a new app service instance but not so low that I am paying unnecessarily for processing power that's not needed. Budget is a significant factor.
Question: How long does it take for an Azure App Service instance to be available after a scale out? In other words, how long does it take for an Azure App Service to scale out?
P.S. I recognize that there is a lot more to scaling in/out that I am not addressing here. I'm trying my best to be succinct. :)
Generally, not long at all. By that I mean typically under one minute, but the time will vary depending on several factors, such as application size, time of day, region of deployment.
You could scale out manually and inspect the run history logs on the scale out tab.
FYI you can also use Azure Monitor to create auto-scale policies, in case this is of any use to you.
I noticed that our app was experiencing high CPU usage. In the diagnostics I found the below message.
High CPU usage was detected for the kudu app for 'DemoApiApp'(39.1%) on only one instance out of 4 instances in your app service plan. The affected instance had a peak overall usage of 87.8% during this time. High CPU usage in the kudu process is most often caused by web job usage. Affected instance name: RD0003FF1C445A
Note that, apps in the same App Service plan share the same compute resources. To determine whether the new app has the necessary resources, you need to understand the capacity of the existing App Service plan, and the expected load for the new app. Overloading an App Service plan can potentially cause downtime for your new and existing apps. Refer App Service limits for more details.
As specified in the documentation, isolate your app into a new App Service plan when:
-The app is resource-intensive.
-You want to scale the app independently from the other apps the existing plan.
-The app needs resource in a different geographical region.
If your process is running slower than expected, or the latency of HTTP requests are higher than normal and the CPU usage of the process is also high, you can remotely profile your process and get the CPU sampling call stacks to analyze the process activity and code hot paths. Refer Remote Profiling support in Azure App Service for more details.
Hope this helps.
I am trying to figure out the reason why an Azure WebJob sporadically fails with OutOfMemoryException.
There are 3 App Services assigned to the same Standard 3 App Service plan (4 cores, 7GB RAM). One of them consists of a set of static HTML, CSS and JS files. Another App service is an ASP.NET MVC application. The last one is a set of WebJobs (1 continuous and 3 triggered).
One of the triggered WebJobs is an import which runs at night when there are no traffic from the users. Some times the import fails with an OutOfMemoryException. According to the Azure Metrics graphics, RAM utilization of the Service Plan is never bigger than 50% with an average value of about 40%. The App Service with the job uses up to 1.3 GB of RAM.
My question is how is it possible that OutOfMemoryException occurs, but there is no respective evidence of critical RAM usage on the graphics?