31

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?

ttugates
  • 5,818
  • 3
  • 44
  • 54
  • Have you tried looking at Memory Percentage on the App Service plan via Azure Monitor? https://learn.microsoft.com/en-us/azure/monitoring-and-diagnostics/monitoring-supported-metrics#microsoftwebserverfarms – Andy Shen Jan 17 '18 at 05:39
  • [@Andy Shen](https://stackoverflow.com/users/1912464/andy-shen) - My project today is to implement a solution with [Microsoft.Azure.Management.Monitor.Fluent SDK](https://www.nuget.org/packages/Microsoft.Azure.Management.Monitor.Fluent/1.3.0-beta) from this [SO](https://stackoverflow.com/questions/46639014/azure-fluent-api-appserviceplanoperations-listmetricswithhttpmessagesasync-ret#answer-46642228). I would prefer to use [Azure Management Libraries for .NET](https://github.com/Azure/azure-libraries-for-net) but Monitor is "Coming Soon" - This question was about Kudu or Dashboard. – ttugates Jan 17 '18 at 12:38

2 Answers2

28

Watch a quick video to understand different aspects shown in this view https://www.youtube.com/watch?v=lWeutt1GvRs

  1. Go to the Diagnose and Solve Problems blade for your Azure App in the Azure Portal.
  2. Choose the Availability and Performance category
  3. Choose either Memory Analysis on the left or click on the Memory Usage card on the right
  4. 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.

Screenshot of Memory Drilldown view

App Level Breakdown

enter image description here

Puneet Gupta
  • 2,237
  • 13
  • 17
  • 4
    This does not give a full breakdown as the title asked. I get a graph of all "Web Apps" in the "App Service." Summing all their percentages shows a max usage of 36.2% at the time the "Memory Resource Exhausted" was thrown. – ttugates Jan 17 '18 at 12:32
  • @PuneetGupta thank you so much for teaching me about the "Diagnose and solve problems". I didn't know how to get a per App Service debugging. <3 – ElMesa Nov 26 '18 at 03:49
  • 1
    So how do you tell the apps apart when it's more than half a dozen? The colors are used multiple times and there are no tooltips on the graph points. – John Mar 01 '19 at 09:36
  • Not sure, what you are looking at exactly. But for me, tooltips are shown, when hovering the graphs. And you can also hide single graphs by clicking the dot in the legend. – twomm May 24 '19 at 08:35
  • I don't see these options – Tiju John Dec 09 '21 at 09:46
  • @TijuJohn I also don't see this option. I wonder if it's been removed or moved or if it's only available on certain tier plans. – Kevin Feb 14 '23 at 02:28
4

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 1

Screenshot 2: Full breakdown of memory usages per app per instance on your App Service Plan Screenshot 2

jtate
  • 2,612
  • 7
  • 25
  • 35
taviandir
  • 81
  • 1
  • 4