Santry Technology Solutions, Content Management, DotNetNuke, SharePoint Consulting
Register | Login
Wednesday, January 07, 2009

Sections
  
About Us
  
Partners
Downloads
  
 WWWCoder.com Resource Directory

Which w3wp.exe process belongs to which App Pool in IIS6
10/29/2004 8:10:52 AM

Along with Windows Server 2003 and Internet Information Services 6.0 came a large number of benefits. For us IIS admins, it was a great welcome set of changes. But, one apparent difficultly is matching up the w3wp.exe processes displayed in Task Manager to the Application Pools in IIS.

By Scott Forsyth

Along with Windows Server 2003 and Internet Information Services 6.0 came a large number of benefits. For us IIS admins, it was a great welcome set of changes. But, one apparent difficultly is matching up the w3wp.exe processes displayed in Task Manager to the Application Pools in IIS.

Review of IIS5

In IIS5.0 (Windows 2000 Server), each site that is set to Out Of Process will spin up a new instance of dllhost.exe. Windows Task Manager lists them. Now, the trick is to find out which dllhost.exe matches which site. My favorite way is to use Component Services. To do so, open Component Services from Administrative Tools, drill down to Computers -> My Computer and select COM+ Applications. Now select View from the top menu and select Status. Beside each site that currently has a dllhost.exe process spun up is the Process ID (PID). Using Task Manager, you can tell the memory and CPU.

Note: If the Process ID doesn't display for you in Task Manager, select View -> Select Columns and add it.

What about IIS6?

But, that doesn't work anymore with IIS6.0. Now each site in IIS6 is placed in an Application Pool. Each Application Pool is completely separated from other App Pools by running in its own process called w3wp.exe. This make life SO much easier. Now, the trick is to match up the process shown in Task Manager with the Application Pool set up in IIS.

If there is a different user for each application pool, Windows Task Manager is the easiest way to find out which application pool belongs to which site since Task Manager will display the user the process runs as.

But, what happens if you have multiple application pools running as the same user? For example, if you keep to the default NETWORK SERVICE user but create multiple Application Pools, you may want to know which process belongs to which App Pool. Component Services doesn't work for this anymore.

Enough already, tell me how to do it!

Have no worries, Microsoft has given us the exact tool for the situation. IISApp.vbs lists all the applications, their PID and their App Pool name.

The script is already placed in systemroot\system32 on Windows Server 2003 so simply go to your Command Prompt and type in iisapp.vbs (the .vbs is optional) and you'll have an instant list of all the App Pool information you've always wanted to know. You may need to type cscript iisapp.vbs if CScript isn't your default WSH script host.

Let's see an example of the output:

W3WP.exe PID: 1468 AppPoolId: AppPoolForSite1.com
W3WP.exe PID: 3056 AppPoolId: AppPoolForSite2.com
W3WP.exe PID: 1316 AppPoolId: AppPoolForSite3.com

Direct from the horse's mouth, Microsoft documents this:

http://www.microsoft.com/resources/documentation/WindowsServ/2003

Summary

We've seen here that using iisapp.vbs, you can painlessly match up the PID to the friendly name of the Application Pool.

Scott Forsyth is Director of IT with ORCS Web, Inc. - a company that provides managed hosting services for clients who develop and deploy their applications on Microsoft Windows platforms.


Page Options:
format for printing  Format for Printer
email article  Email Page
add to your favorites   Add to Favorites
How would you rate the quality of this content?
Poor - - Excellent
Comments?
Overall Rating:
Comments Left:
Left on 11/10/2008 10:57:42 PM by Anonymous
Comments: reaaly good and useful information
Left on 8/26/2008 6:10:41 AM by Anonymous
Comments: Super article...... by Prashanth Desai
Left on 8/26/2008 6:08:40 AM by Anonymous
Comments: Super
Left on 4/16/2008 6:52:15 AM by Anonymous
Comments: Really nice!
Thanks for the usefull information =)
Left on 1/16/2007 2:34:44 PM by Anonymous
Comments: excellent. Now I have proof that it isn't my app pool that is causing teh issues...
Left on 9/16/2006 12:56:16 AM by Anonymous
Comments:
Left on 9/12/2006 11:47:36 AM by Anonymous
Comments: very good hint
Left on 4/5/2006 9:42:35 PM by Anonymous
Comments: Saved my butt. Now to find out what in the Default pool is causing the memory leak!
Left on 3/18/2006 10:29:23 AM by Anonymous
Comments: "Direct from the horse's mouth, Microsoft documents this: " so why on earth don't they simply add this as an optional column in the Windows Task Manager! Grrrr!@!
Left on 3/1/2006 9:08:56 AM by Anonymous
Comments: Very good info
No ratings available.
Left on 1/31/2006 10:54:14 AM by Anonymous
Comments: Just what I was looking for!
No ratings available.
Left on 1/25/2006 10:00:20 AM by Anonymous
Comments: Great!  Just what I was looking for and I found it with an easy search!!
Left on 1/13/2006 1:35:43 PM by Anonymous
Comments: oh thank you, I've been looking for this.
Left on 9/1/2005 4:53:02 PM by Anonymous
Comments: good information--this is exactly the kind of relatively undocumented feature i'm glad to now have some documentation on
No ratings available.
Left on 8/4/2005 2:49:45 PM by Anonymous
Comments: Great information.
Left on 6/17/2005 4:04:03 PM by Anonymous
Comments: To the point without fuss
Left on 1/17/2005 2:32:43 AM by Anonymous
Comments: Great.  I learnt something new.  I would have just killed the whole app pool in the production environment to great detriment.  Forewarned is for armed.  Now if I can only find my IIS 6 admin book and figure out how to work around my application errors with the fault tolerant features already built into IIS 6.  Beats rewritten a fault tolerant sub layer into the product.  It's a cow to justify more development time on something the customer has already baught.  Go forward and progress not regress.

TA ("j)
Left on 1/13/2005 11:56:31 AM by Anonymous
Comments: Good work! Man!
  

 Latest Articles
  

 Latest News
  

 

Spotlight
Syndication

 


 


Digg This
 


DotNetNuke Platinum Benefactor

  
 

 Terms Of Use | Privacy Statement
 Copyright 2008 - Santry Technology Solutions, Box 172, Girard, PA 16417, (814) 774-0970