【问题标题】:Windows Server 2008 R2 C:\Perl\bin\perl.exe execution log (or monitoring) to locate file processing its high CPU usageWindows Server 2008 R2 C:\Perl\bin\perl.exe 执行日志(或监控)定位文件处理其高 CPU 使用率
【发布时间】:2020-05-15 13:26:44
【问题描述】:

我们有用 perl 5 编写的软件,用户可以通过 windows 2008 服务器在线访问。

C:\Perl\bin\perl.exe 正在执行一个文件,该文件会无限期地导致高 CPU 处理。根据我们的经验,我们分析了任务管理器和资源管理器,它非常“模糊”:数据变化太快,与导致问题的文件没有真正的关联。

我们想要关联在 CPU 长时间以 100% 达到最大值时调用哪个文件来运行。

如果 C:\Perl\bin\perl.exe 正在运行,那么有没有办法确定它正在执行什么?

我们查看了资源管理器的“概览”、“CPU”和“磁盘”。 CPU 选项卡不会告诉我们文件名,而磁盘和概览选项卡不会显示 cpu 处理。

【问题讨论】:

  • perl解释器perl.exe是如何启动的?
  • web请求通过perl的CGI库,这些页面访问一个数据库,从各种perl文件写接口。有用户访问源代码中存在问题的 perl 文件。

标签: windows perl logging server cpu


【解决方案1】:

命令行(包括参数)可通过 WMI 获得。

>wmic process where "name like '%perl%'" get ProcessId,CommandLine
CommandLine   ProcessId
perl  foo.pl  9900
PS> Get-WmiObject Win32_Process -Filter "name like '%perl%'" `
   | Select-Object ProcessId,CommandLine

ProcessId CommandLine
--------- -----------
     9900 perl  foo.pl

如果您更喜欢 GUI,可以使用 [Process Explorer]](https://docs.microsoft.com/en-us/sysinternals/)(来自 Microsoft)。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2023-04-03
    • 1970-01-01
    • 1970-01-01
    • 2013-07-10
    • 2012-11-16
    • 1970-01-01
    • 1970-01-01
    • 2013-08-22
    相关资源
    最近更新 更多