首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >在Windows上为Perfmon/LogMan指定性能计数器时,如何只获取w3wp实例?

在Windows上为Perfmon/LogMan指定性能计数器时,如何只获取w3wp实例?
EN

Stack Overflow用户
提问于 2012-01-10 19:20:43
回答 2查看 1.3K关注 0票数 0

希望这个问题有一个简单的答案,我忽略了!我有一个IIS with服务器,上面有多个站点。在Perfmon中,它们以w3wp#1、w3wp#2等的形式出现.我正在编写一个Logman脚本,它将使用我指定的计数器/实例收集性能计数器数据,我只想收集任何w3wp工作进程。

我试过几种方法,但没有运气:

代码语言:javascript
复制
    \.NET CLR Memory(*w3wp*)\
    \.NET CLR Memory(w3wp#*)\
    \.NET CLR Memory(w3wp*)\

我看过文档这里,它似乎声称支持通配符,但不支持部分匹配。我不知道该怎么做。有办法实现我想要的吗?希望我解释得够清楚。如果需要更多的细节,请告诉我。

谢谢!

EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2012-01-17 23:37:32

我想出了一个自定义批处理脚本,它找到应用程序池ID、PID,并将其与所讨论的IIS工作进程关联起来。从那里,我可以手动找到并替换perfmon配置文件中的通用占位符,以便开始收集特定站点的信息。如果有兴趣,我可以提供一些细节。

票数 0
EN

Stack Overflow用户

发布于 2015-06-15 06:59:28

有一种方法可以通过向实例附加进程Id来显示实例。由于ProcessId不更改,因此有助于确定正确的实例。这篇文章描述了方法- Perfmon:通过PID而不是实例来识别进程

链接中的相关部分:

代码语言:javascript
复制
Making below registry change will display processes in the format of **ProcessName_PID** instead of **ProcessName#1**. 
Click Start, click Run, type regedit, and then click OK.
Locate and then click the following registry subkey:

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\PerfProc\Performance
On the Edit menu, click New, and then click DWORD Value.
Right-click New Value #1, click Rename, and then type ProcessNameFormat to name the new value.
Right-click ProcessNameFormat, and then click Modify.
In the Data value box, type one of the following values, and then click OK:

    1: Disables PID data. This value is the default value.
    2: Enables PID data.

Exit Registry Editor.
 
Warning: Serious problems might occur if you modify the registry incorrectly by using Registry Editor or by using another method. These problems might require that you reinstall the operating system. Microsoft cannot guarantee that these problems can be solved. Modify the registry at your own risk.

Important: If you enable this feature, you may be unable to monitor process-specific information by using third-party utilities or custom-made programs, and this functionality may change at any time in the future without notice.

希望它能帮到别人。

票数 3
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/8809206

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档