IIS 6 Performance Monitoring – Convert ‘w3wp’ Process Names to PIDs or Usernames

iisiis-6performance-monitoring

I'm running some perfmon counters / reports on an Windows Server 2003 IIS6 web server, that has each web site running under its own application pool/worker process user.

The report is providing the names of the sites as, for example:

w3wp#29
w3wp#30
w3wp#31
w3wp#32

I need the worker process names (or PID) so I can determine which web site each relates to.

The #29, #30, #31, etc numbers are not PIDs, because when I enable PID view in Task Manager or if I enable the 'Command Line' column in Sysinternals Process Manager, or use the iisapp.vbs script – the PID's are longer numbers.

I haven't been able to find anything to convert the above processes into the application pool user name or at least the PID so I can cross reference it to the site using the iisapp.vbs script.

I researched this and did come across a registry setting that may do what I'm looking for but unless there's not other way I don't want to make registry changes:

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\PerfProc\Performance]
"ProcessNameFormat"=dword:00000002

Any ideas on how to look up or convert the w3wp#XX processes to either application pool username or PID?

Thanks

Best Answer

To cross-reference, you can use the process counter "ID Process". Include that in the perf data and it will show the PID for the process. That's fine for a one-off cross reference but it's a bit of a pain.

I still recommend the registry change if you can do it. In my opinion, the registry change should be part of any base build.

Here's a blog post that covers the same and confirms the registry change: http://weblogs.asp.net/owscott/archive/2007/03/19/registry-change-for-perfmon-and-pid-data.aspx