环境: Asp Net MVC 应用程序(.net Framework 4.5.1)托管在 Azure 应用程序服务上,具有两个实例。 应用程序使用 Azure SQL 服务器数据库。 此外,应用程序使用 MemoryCache (System.Runtime.Caching) 进行缓存。
最近,我注意到该应用程序的可用性丢失。这种事几乎每天都会发生。
观察结果: 实例 RD0003FF1F6B1B 上的内存计数器每秒页读取数处于危险级别 (242)。任何超过 200 的值都可能导致该实例上的任何应用程序延迟或失败。
“内存计数器页面读取/秒”是什么意思? 如何解决这个问题?
最佳答案
What 'The memory counter Page Reads/sec' means?
我们可以从这个blog得到答案。建议的每秒页面读取次数应低于 90。值较高表示内存不足和索引问题。
<小时/>“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?
根据我的经验,你可以尝试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.
关于asp.net-mvc - Azure 应用服务可用性损失。内存计数器每秒页读取数处于危险水平,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47350199/