We recently ran out of memory on our sites under an Azure App Service Plan.
This threw a "Memory Resource Exhausted" error on all Apps.
Clicking "CPU Percentage and Memory Percentage" shows a spike to 82% in last 24 hours.
Navigating to "Metrics per Instance (App Service Plan)" I get a visual of all Web Apps.. Adding up ALL their Working Set in MBs added up to 22% at time of 82% App Service Plan usage.
This SO answer suggests viewing memory usage in Kudu.
Does Azure Dashboard or Kudu have any way to show a break down of specifically "App Service Plan" memory usage?
Watch a quick video to understand different aspects shown in this view
https://www.youtube.com/watch?v=lWeutt1GvRs
Go to the Diagnose and Solve Problems blade for your Azure App in the Azure Portal.
Choose the Availability and Performance category
Choose either Memory Analysis on the left or click on the Memory Usage card on the right
This launches the Memory Analysis tool.
Under the Memory analysis tool:-
The very first thing shown is App Service Plan Density – This checks looks for overstuffed App Service Plans and beeps if it finds that you have too many apps in the same app service plan
An insight is shown if we detect or more apps consuming high memory
Private Bytes consumption for the current app
Physical memory in use for each instance allotted to the App Service Plan
And then Memory Drill down shows Per instance memory drilldown for each app and its associated process running on that instance.
App Level Breakdown
A dated question, but I've found a view that shows this data that I believe did not exist at the time this question was posted.
Go to Diagnose and solve problems and search for "memory" in the input box labeled "Search App Service Diagnostics" at the top of the view. Choose Memory Drill Down in the results.
There you will see a full breakdown of all the apps running per instance on your App Service Plan:
Screenshot 1: Search results for "Memory" in "Diagnose and solve problems" view
Screenshot 2: Full breakdown of memory usages per app per instance on your App Service Plan
Related
I have an Azure App Service Plan (tier P1V2) that contains a number of App Services. Each of the App Services is attached to an Application Insights instance.
The App Service Plan Overview shows a CPU usage summary of 100%, but Application Insights Live Metrics shows a very low CPU usage.
Is there an explanation for the values being very different or am I doing something wrong?
Here are images showing what I am seeing. (Note that the first is taken over roughly 1 hour and the second one is over 60-seconds, but the figures have been the same throughout the time I have been looking at this.)
About the difference between the two charts:
What is shown in 'Live Metrics Stream' is the CPU usage of w3wp process, whereas what is shown in App Service Plan level is the total Machine CPU usage.
For the 100% CPU usage in Application Insight. You can use Diagnostics and Solve Problem to see what going wrong.
You also can have a look at this issue to find out what process is occupying CPU kindly look for total_cpu_time/user_cpu_time/privileged_cpu_time..
I am trying to understand the reason of max CPU percentage/memory utilization of app service plan but unable to find any simple way in azure portal. In my app service plan there are 20 app services created and out of 20 only 2-3 app service I am using for user interface and others are using as web API or as background jobs (like webjobs). My app service plan is in isolated pricing tier and average memory and CPU utilization is good it's about 60% but when I check it for max utilization then I found it's being spike up to 90%. Is there anyway to find out the reason of reaching of app service plan utilization up to 90% ?
I am also using SQL database and database is in premium tier. Will DB utilization can impact app service plan utilization?
Please suggest.
You can check this by using the built-in feature of azure web app(see this doc).
Nav to azure portal -> your azure web app -> in the left panel, click on Diagnose and solve problems -> click on Proactive CPU Monitoring, then you can see what is consuming high CPU resources.
Hope it helps.
Thanks for asking question! To add to this, you may also enable Application Insights for particular app.
In case if you haven’t enabled, follow the below steps.
Go to Web App -> Monitoring -> Application Insights -> enable
If ‘Application Insights’ already enabled, you can find the details under ‘Metrics’ tab.
This will give you a detailed view of what is happening in both server and client side.
For more details, refer to Monitor Azure web app performance
I have B3 service plan with 7GB RAM and 3 app services into a resource group. One service requires over 4GB but it throws out of memory exception after 2.4GB usage. It looks like available memory is divided between 3 services evenly. How can I manage RAM usage?
One way I can think of would be to put the apps on separate app service plans. One of your apps requires quite a lot, so why not give it its own plan?
Then you would have one Basic 3 service plan for that app, and maybe a Basic 1 plan for the other 2 if that is enough for them?
Yes, you are correct. The RAM listed for each instance size based on the pricing tier that you choose is for the underlying VM. So, this includes the OS and various infrastructure processes, in addition to IIS and your Web Apps. It is also shared with the App Services deployed under the same App Service plan.
This issue could be related to your web application, you may try the following:
View the memory utilization in Azure new portal
(http://portal.azure.com).
Use kudu Diagnostic Dump to see the information of memory
consumption.
Move the Web App to another App Service plan that has only one Web
App.
I would suggest you refer the blog post How to view the memory utilization of your Azure Web Site for more details.
I am trying to measure CPU usage for one of my Azure App Services by going to the "Site Metrics per Instance". The problem is that there is no option to check the CPU usage but CPU time and other stuff like "Average memory working set" and "Data In/Out".
Does someone know how and where I can see the CPU usage for one App Service?
You app is related to an App Service plan : monitoring the plan will give you a percentage, but the app can only be monitored about its own metric : its own CPU time. You can imagine changing the plan for the app then the % would be different. So, on the app itself you can only measure the app CPU time, as % is depending on the plan.
On the old/classic portal, you can see the CPU metric by selecting you service and "Monitor": isn't this the CPU usage that you are looking for ?
Just go to App's Metrics > In resource panel select your App Plan related to your App > Now In Metrics panel you will get "CPU PERCENTAGE" Option.
The Azure management dashboard gives you the possibility to monitor metrics such as CPU utilization, network in/out, response time, among others.
But how can you measure consumption/availability of memory? I am running a web app that is memory intensive, and it is hard for me to gauge which instance types (or number of instances) I should provision without having an understanding of the memory situation across time.
Yes, my service is a web role on Azure cloud services, I am not talking about VMs (IaaS) here.
Thanks
In your Azure project, in the Roles folder you'll find a folder for each of your Roles. If you use the latest version of the SDK you'll find a file called diagnostics.wadcfg. This is where you'll be able to configure Performance Counters, like \Memory\Available Bytes. This file will also allow you to configure the sample rate (ex: every 30 sec) and the scheduled transfer period (how frequently the logs should be transferred to your Storage Account).
Then you can use a tool like the Azure Diagnostics Manager to view memory consumption over time.
More information: Using performance counters in Windows Azure
A way to do this from the Management Console:
On the Configure tab for your web role, in the monitoring section, change level to Verbose.
On the Monitor tab at the bottom, click Add Metrics
With monitoring set to Verbose, the available metrics should include Memory Available.