获取性能计数器实例名称(W3WP#XX)从ASP.NET工作进程ID [英] Get Performance Counter Instance Name (w3wp#XX) from ASP.NET worker process ID

查看:673
本文介绍了获取性能计数器实例名称(W3WP#XX)从ASP.NET工作进程ID的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想展示一些内存统计数据(工作集,GCS等)使用.NET /工艺性能计数器在网页上。不幸的是,如果有服务器上的多个应用程序池,他们使用一个索引(#1,#2等)的区别,但我不知道如何搭配一个进程ID(我有)到#XX指数。有没有一种编程方式(从ASP.NET网页)?

I would like to display some memory statistics (working set, GCs etc.) on a web page using the .NET/Process performance counters. Unfortunately, if there are multiple application pools on that server, they are differentiated using an index (#1, #2 etc.) but I don't know how to match a process ID (which I have) to that #xx index. Is there a programmatic way (from an ASP.NET web page)?

推荐答案

先打在谷歌:

多个CLR性能计数器显示具有类似于W3WP#1的名字

当多个ASP.NET工作进程
  正在运行,公共语言运行库
  (CLR)性能计数器将有
  类似于W3WP#1或名称
  W3sp#2等。这是补救
  在.NET框架2.0包括一个
  在.NET命名柜台进程ID
  CLR内存性能对象。这个
  计数器显示进程ID为
  实例。您可以使用此计数器
  确定CLR性能计数器
  是与一个进程相关联

When multiple ASP.NET worker processes are running, Common Language Runtime (CLR) performance counters will have names that resemble "W3wp#1" or "W3sp#2"and so on. This was remedied in .NET Framework 2.0 to include a counter named Process ID in the .NET CLR Memory performance object. This counter displays the process ID for an instance. You can use this counter to determine the CLR performance counter that is associated with a process.

此外 KB 281884

默认情况下,性能监视器
  (Perfmon.msc)显示多个
  具有由相同名称的进程
  列举的过程
  下列方式:

By default, Performance Monitor (Perfmon.msc) displays multiple processes that have the same name by enumerating the processes in the following way:

流程#1#处理工艺2#3

Process#1 Process#2 Process#3

性能监视器还可以显示
  这些过程通过附加
  进程ID(PID),以在名
  下列方式:

Performance Monitor can also display these processes by appending the process ID (PID) to the name in the following way:

Process_PID

Process_PID

这篇关于获取性能计数器实例名称(W3WP#XX)从ASP.NET工作进程ID的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆