9

Environment: Asp Net MVC app(.net framework 4.5.1) hosted on Azure app service with two instances. App uses Azure SQL server database. Also, app uses MemoryCache (System.Runtime.Caching) for caching purposes.

Recently, I noticed availability loss of the app. It happens almost every day. enter image description here

enter image description here Observations: The memory counter Page Reads/sec was at a dangerous level (242) on instance RD0003FF1F6B1B. Any value over 200 can cause delays or failures for any app on that instance.

What 'The memory counter Page Reads/sec' means? How to fix this issue?

Masoud Darvishian
  • 3,754
  • 4
  • 33
  • 41
  • Hi @VolodymyrGorodytskyi, we seem to meet more often - I just recently had the same problem again - app out for half an hour while seemingly not any more traffic or anything unusual. Any tips that you can share with above problem? – Dirk Boer May 02 '19 at 09:39

2 Answers2

11

What 'The memory counter Page Reads/sec' means?

We could get the answer from this blog. The recommended Page reads/sec value should be under 90. Higher values indicate insufficient memory and indexing issues.

“Page reads/sec indicates the number of physical database page reads that are issued per second. This statistic displays the total number of physical page reads across all databases. Because physical I/O is expensive, you may be able to minimize the cost, either by using a larger data cache, intelligent indexes, and more efficient queries, or by changing the database design.”


How to fix this issue?

Based on my experience, you could have a try to enable Local Cache in App Service.

You enable Local Cache on a per-web-app basis by using this app setting: WEBSITE_LOCAL_CACHE_OPTION = Always

By default, the local cache size is 300 MB. This includes the /site and /siteextensions folders that are copied from the content store, as well as any locally created logs and data folders. To increase this limit, use the app setting WEBSITE_LOCAL_CACHE_SIZEINMB. You can increase the size up to 2 GB (2000 MB) per web app.

Community
  • 1
  • 1
Tom Sun - MSFT
  • 24,161
  • 3
  • 30
  • 47
0

There is some memory performance problems can be listed

  • excessive paging,
  • memory shortages,
  • memory leaks

Memory counter values can be used to detect the presence of various performance problems. Tracking counter values both on a system-wide and a per-process basis helps you to pinpoint the cause in Azure such as in other systems.

Even if there is no change in the process, a change in the system can cause memory problems. the system-wide

researching in the azure:

Shared resources plans (Free and Basic) have memory limits as seen here: https://learn.microsoft.com/en-us/azure/azure-subscription-service-limits#app-service-limits.

Quotas: https://learn.microsoft.com/en-us/azure/app-service-web/web-sites-monitor

Also, you can check in the portal under your web app settings, search for “quotas”, and also check out “Diagnose and solve problems” and hit “metrics per instance (app service plan)” which will show you memory used for the plan.

A MemoryCache bug in .net 4 can also cause this type of behavior https://stackoverflow.com/a/15715990/914284

Hamit YILDIRIM
  • 4,224
  • 1
  • 32
  • 35