【Azure App Service】分享App Service for Window中自动抓取Memory DUMP的方法

问题描述

当应用部署到Azure App Service后,如果突然遇见应用内存上升的情况,如果想 第一时间的抓取Memory DUMP,以便于分析出内存占用到上限值的根源,有什么好的办法呢?

问题解答

如果是 Windows App Service,最简单的做法是开启 Auto-Heal:触发条件选内存上限,动作选 Collect a Memory Dump。进程私有内存超过阈值时,系统会自动抓 dump。

Auto-Heal provides you with an easy way to take an action when your app is having an unexpected behavior. The triggers and actions allow you to define various conditions based on request count, slow requests, memory limit on which you can take specific actions like restarting the process, logging an event, or starting another executable. Please note that these mitigations should only be considered a temporary workaround until you find the real cause for the issue causing the unexpected behavior.

具体的操作步骤如下:

  1. 打开 Azure Portal,进入目标 Web App。
  2. 依次点 Network → Troubleshoot → Auto-Heal。
  3. 打开 Custom Auto-Heal Rules(自定义自动修复规则)。
  4. Conditions(触发条件):选 Memory Limit,填内存阈值。这个值指的是单个实例上 w3wp 进程的 Private Bytes。
  5. Actions(动作):选 Custom Action → Collect a Memory Dump。
    • 可以选抓完 dump 后是否同时分析,或是否重启进程(Kill)。
    • 如果门户提示配置存储账户,就按提示绑定一个。dump 会写到那个存储账户里。
  6. Override when action executes(最短运行时间):建议设成 5--10 分钟,防止进程刚启动就反复触发。
  7. 点 Save。保存后站点会重启一次,规则才会生效。

操作步骤截图参考:

参考资料

Auto Healing Experience in App Service Diagnostics :Announcing the New Auto Healing Experience in App Service Diagnostics - Azure App Service


当在复杂的环境中面临问题,格物之道需:浊而静之徐清,安以动之徐生。 云中,恰是如此!

相关推荐
明志数科1 天前
机器人训练数据获取困境:互联网数据为何无法直接复用
人工智能·深度学习·microsoft·机器学习·机器人
宝桥南山1 天前
.NET 11 - 尝试一下Minimal API中的异步验证新特性
microsoft·微软·c#·asp.net·.net·.netcore
IT大白鼠1 天前
2026 年 9 月至今重大安全漏洞专题报告——微软产品高危漏洞深度解析
安全·microsoft
海盗12341 天前
微软技术日报 2026-10-14:十月补丁 1411 个漏洞,.NET 11 交出 RC2
人工智能·microsoft·机器人·aigc·.net
Access开发易登软件1 天前
我全新开发了一套 Access 通用 Excel 导入工具,现在开源了
数据库·microsoft·excel·mfc·vba·access·access开发
易点云徐源1 天前
Microsoft Teams 桌面端黑屏与登录异常排查:账户会话和网络路径的影响
网络·microsoft
佛系彭哥2 天前
国际版MC入坑教程
microsoft
frankzch2 天前
微软 137B 编码模型搬到 PC:端侧推理与 Agent 权限防线
人工智能·深度学习·microsoft·机器学习·语言模型
AI技术新视界2 天前
BitNet (bitnet.cpp) :微软的高性能推理框架
microsoft·推理引擎