TechTip: Which w3wp.exe is which Application Pool in IIS6?

So your IIS6 web server's CPU utilization is through the roof, caused by one of the w3wp.exe processes using up all the processor cycles? Sure, recycling that application pool would probably fix this, but which one, if you have a dozen w3wp.exe processes showing up in Task Manager?


Turns out that there is a handy little script included with Microsoft IIS, that can print out the process ID, and application pool name of every running w3wp.exe! Located in %systemroot%\system32 (usually C:\Windows\System32) folder, you should find a script named iisapp.vbs to launch which all you need to do is enter it's name from the command line:



cscript %systemroot%\system32\iisapp.vbs

Optionally you can include the PID (Proccess Identifier) of the offending w3wp.exe (you can get the pID to display in the Task Manager by going to View -> Select Column -> PID under the "Processes" tab) to search for that application only instead of listing all of them:

cscript %systemroot%\system32\iisapp.vbs /p 1472

"Reverse" lookup is also available - you can lookup the PIDs serving an individual application pool, by it's name, if you don't feel like opening the task manager of if you, for example have the command-line only access to the system:

cscript %systemroot%\system32\iisapp.vbs /a DefaultAppPool


Microsoft TechNet Article

No comments: