Registry change for perfmon and PID data
Perfmon is a great tool for mining performance data on a server and has a slew of objects and counters to expose most any type of data.
As nice as it is, there is one thing that can be difficult to do, and that is to view data for temporary objects. For example IIS worker processes only live until the next recycle or restart. If there are many worker processes on the server, the default view doesn't allow you to tell which is which.
Notice in the screenshot that there are three w3wp.exe worker processes on this server in the section on the right, but you can't tell from this view which belongs to which worker process.
A co-worker of mind pointed me to this great registry setting today that takes care of this. http://support.microsoft.com/kb/281884. Through a simple registry change, you can view the PID of each worker process within perfmon. It can be obtained without the registry change, but through extra effort.
As long as you know the PID, you can match it up to the app pool easily. In IIS6, you can use iisapp.vbs. In IIS7, you can use "appcmd list wp". Of course Task Manager is a key tool that is often used in parallel to show active PIDs, worker processes and various other real-time counters.
The registry change is quick and painless. In fact, after making the change, I closed the Add Counters windows in perfmon and opened it again and the PID was there immediately. No restart necessary.
If you want to save a click or two, you can follow the following steps instead of doing the change manually:
Take the following indented text and save to your desktop and call it showPID.reg.
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\PerfProc\Performance]
"ProcessNameFormat"=dword:00000002
Double click, acknowledge the prompt and you're done!
Disclaimer: Any changes to the registry needs to be done with an awareness of the impact. There is always the chance that some tool, or another administrator, needs this to be at the default setting. While it is safe in most environments, I can't be held liable for any negative impact that this change has.