windows – 当CPU百分比达到X时如何启动程序

我一直有一个非常间歇性的问题,一个ASP.NET v 4.0应用程序可能发生4天,发生的情况是cpu将飙升至75%,有时会运行正常,直到一天结束时有时会稳步增长到100 %

然后我必须重启服务器.

我已经按照每个指南“当工作进程处于100%cpu时该怎么做”而且我知道它是哪个工作进程,它是哪个应用程序池.我所能做的就是找到进程并将其杀死或回收应用程序池,这有时会有所帮助.

我不知道的是当cpu达到75%时系统上正在发生的事情.

我想知道有什么方法可以在cpu命中50%并运行2分钟时启动procmon,然后关闭并保存数据?

从未做过,但最简单的方法是在perfmon中使用alert.

如下所示,您可以在操作发生时运行脚本.

Select the Action tab,shown in figure 3-18. You can Now specify any
of the following actions to happen when an alert is triggered:
Log An Entry In The Application Event Log Creates log entries for alerts.

Send A Network Message To Sends a network message to the computer specified.

Run This Program Sets the complete file path of a program or script to run when the alert occurs.

更多信息there设置警报

在你的脚本之后,你可以这样运行;

procmon /Quiet /Minimized /backingFile log.PML
TIMEOUT /T 120
procmon /Terminate

相关文章

Windows注册表操作基础代码 Windows下对注册表进行操作使用的...
黑客常用WinAPI函数整理之前的博客写了很多关于Windows编程的...
一个简单的Windows Socket可复用框架说起网络编程,无非是建...
Windows文件操作基础代码 Windows下对文件进行操作使用的一段...
Winpcap基础代码 使用Winpcap进行网络数据的截获和发送都需要...
使用vbs脚本进行批量编码转换 最近需要使用SourceInsight查看...