How to find out which w3wp.exe is mapped to which Application pool

Looking at the processes of one of my servers, I notices a huge memory consumption on one of the w3wp.exe’s running on the Moss server. Immediately I wanted to find out which SharePoint Webapp is causing this. And there I was….. Well you need to know the Process ID first (View -> Select Columns… in Task Manager) and then you can use the iisapp.vbs tool that comes with IIS. 
I found this information on the this post from the Thoughts about IIS (and now SharePoint blog) which describes the following: 
During the course of working through issues, I get asked at least twice a week how to determine which application pool maps to a particular worker process PID (Process ID) on a server.  I suppose there are lots of ways to determine this, but here two that come to mind to determine the answer. 
The first way, and by far the easiest, is to use one of the new scripts that come in the box called IISAPP.VBS.  It is located in the %SystemRoot%\system32 directory.  For example: 

C:\WINDOWS\system32>cscript iisapp.vbs
Microsoft (R) Windows Script Host Version 5.6
Copyright (C) Microsoft Corporation 1996-2001. All rights reserved.

W3WP.exe PID: 1172 AppPoolId: StsAdminAppPool
W3WP.exe PID: 2656 AppPoolId: MSSharePointAppPool
W3WP.exe PID: 2148 AppPoolId: WMS App Pool
W3WP.exe PID: 3604 AppPoolId: defaultwebsite

As you can see, this script makes it very easy to determine what the PID is of each specific Application Pool.  This is nice to use when trying to determine which PID you may want to snap a dump of for debugging purposes.

Leave a Reply

Your email address will not be published. Required fields are marked *