1
votes

I think we've got a memory leak, but I'm not sure how. It seems be only be occuring on the App Service Plan, but not on the App Services running on it. Is this an issue in Azure? Has anyone else experienced it? Details below.

...

We have 2 slots per App Service Plan (Prod and RC) running 3 and 1 instances respectively. Each instance is showing 3-5% memory usage, usually about 3% on RC due to the much lower traffic, 4-5% on production.

If it makes any difference we're on Linux App Service Plans running on the P1v2 tier using the standard Microsoft Linux image for Node 8. We have 3 app service plans in use and all are showing the same strange problem. Before going down the route of MS support I thought I'd see if anyone else has had the issue or can point to places to look.

It almost seems like docker on the host is not clearing out the old running instances so they continue to consume memory, but I could be wrong.

Edit: I found this, it explains the difference but not the reason for this problem. https://blogs.msdn.microsoft.com/benjaminperkins/2016/11/01/memory-metrics-for-an-azure-web-app-and-app-service-plan/

...

The app service plan clearly shows the leak. The dip at the start is after I forcibly restarted as memory was over 80%. App service plan memory usage

The app service looks totally fine. Steady at 4-5% App service memory usage

NewRelic agrees the app services are fine. Ignore the extra hosts, NewRelic is showing all regions on one graph, the Azure graphs are for a single region. App service memory usage seen by NewRelic

1
Did you figure this our? We're seeing the same problem with some appPlans, see this issue: github.com/aspnet/EntityFrameworkCore/issues/15173 - Larsi
No, but we managed to prove it wasn't our application leaking memory. Since then Microsoft has released multiple updates and the memory issues have significantly improved and also release memory when they start to run low. For further safety we have a weekend restart on a Cron job. - Hawxby

1 Answers

0
votes

I've found that the Kudu container can leak memory. If you start a bash shell and run top -b -n 1 -o %MEM you should be able to see the memory usage for this. In some cases I've seen the mono process leak memory and grow quite large overtime. This had been acknowledged as bug by Microsoft and may now be fixed.