Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Azure app service availability loss. The memory counter Page Reads/sec was at a dangerous level

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?

like image 523
Volodymyr Gorodytskyi Avatar asked Feb 04 '23 03:02

Volodymyr Gorodytskyi


1 Answers

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.

like image 72
Tom Sun - MSFT Avatar answered Feb 07 '23 01:02

Tom Sun - MSFT