asp.net-mvc - Azure 应用服务可用性损失。内存计数器每秒页读取数处于危险水平

标签 asp.net-mvc azure out-of-memory azure-web-app-service azure-diagnostics

环境: Asp Net MVC 应用程序(.net Framework 4.5.1)托管在 Azure 应用程序服务上,具有两个实例。 应用程序使用 Azure SQL 服务器数据库。 此外,应用程序使用 MemoryCache (System.Runtime.Caching) 进行缓存。

最近,我注意到该应用程序的可用性丢失。这种事几乎每天都会发生。 enter image description here

enter image description here 观察结果: 实例 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/

相关文章:

redis - 如果服务器有足够的可用内存,为什么 redis 实例会出现内存不足问题?

asp.net-mvc - 带有方法的 ASP.NET MVC ViewModel - 是 "legal"吗?

asp.net-mvc - 关于 ASP .NET MVC 和多层架构的书

javascript - 来自 jQuery 的回调没有到达 Controller/Action

.net - Azure 存储 sdk v1.3 到 v2 => SetConfigurationSettingPublisher

c - 内存不足杀死

asp.net-mvc - “对象”不包含 'State'的定义

c# - 是否可以使用 NETMF 对嵌入式设备进行编程以将 geochron 记录写入 Azure?

azure - 我正在将 AddMicrosoftIdentityWebApi .net core 6 与 MSAL 结合使用。我可以创建自定义中间件吗?

java - 处理预期的 java.lang.OutOfMemoryError : Java heap space 的解决方法