I am trying to add performance counters for an IIS worker process to a collection data set in Performance Monitor.

I know the process ID (PID) of the worker process (a 4 digit number). However, in the configuration of a data collection set, IIS worker processes are listed as numbers from 1 through the number of configured worker processes. They're in the format w3wp#1, w3wp#2, w3wp#3, etc.

So as an example, if the PID I'm interested in is 3865, how would I figure out what w3wp# it is in Performance Monitor?

  • i think you have to enable it backend in the registry to show the process id blogs.technet.microsoft.com/askperf/2010/03/29/… May 2 '18 at 15:11
  • but if i were you i would use perfmon instead so you dont have to touch the registry, but it seems this registry change is common May 2 '18 at 15:12
  • Thanks Michael. The registry change looks promising - seems like that is the exact problem. What I don't understand is your comment "I would use perfmon instead"? I am using perfmon and that's the problem: perfmon lists the arbitrary instance number as opposed to the PID. Is there something I'm missing?
    – MarkB
    May 2 '18 at 15:28
  • i mean an outside tool sysinternals (which Microsoft owns now) , I believe is a better tool for the job IMO and no registry tweaks would have been needed. I will post the solution as an answer May 2 '18 at 15:35
  • Ok, I think I'm following. I guess I assumed that the management application known as Performance Monitor and the exe perfmon.exe were one in the same - but apparently not? I'll check it out. The other thing is that I am looking to turn on logging that will run for days and collect data. Not sure if this other application supports that. But again, I'll check it out. Thanks!
    – MarkB
    May 2 '18 at 16:29

It seems you have to edit the registry to expose this (be careful)

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

  1. Click Start, click Run, type regedit, and then click OK.
  2. Locate and then click the following registry subkey: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\PerfProc\Performance
  3. On the Edit menu, click New, and then click DWORD Value.
  4. Right-click New Value #1, click Rename, and then type ProcessNameFormat to name the new value
  5. Right-click ProcessNameFormat, and then click Modify.
  6. In the Data value box, type one of the following values, and then click OK:
  7. 1: Disables PID data. This value is the default value.
  8. 2: Enables PID data.
  9. Exit Registry Editor.

This solves the problem that you had where They're in the format w3wp#1, w3wp#2, w3wp#3

and now will be in the format

They will now have the PID in the format like so w3wp3865, w3wp2325, w3wp2154

and you can add a performance counter for what your looking for explicitly as you asked w3wp3865


As an alternative, sysinternals perfmon.exe should be able to get performance information (if not more) without altering the registry. But I am not sure If its the exact details you need.

  • Can you explain exactly how this answers the question?  Please do not respond in comments; edit your answer to make it clearer and more complete.
    – Scott
    May 2 '18 at 16:18

One of of the Process' counters is the process id. Use that counter to relate your process to the w3wp#N. Note that this can change from sample to sample when e.g. a process dies or is started. Better to follow the instructions about setting ProcessNameFormat=2.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.