Scott Forsyth's Blog

Postings on IIS, ASP.NET, SQL Server, Webfarms and general system admin.

Which w3wp.exe process belongs to which App Pool in IIS6

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 instead if CScript isn't your default WSH script host.

Let's see an example of the output:

Here is an example of the output.

W3WP.exe PID: 1468   AppPoolId: AppPoolForSite1.com
W3WP.exe PID: 3056   AppPoolId: AppPooForSite2.com
W3WP.exe PID: 1316   AppPoolId: AppPooForSite3.com

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

http://www.microsoft.com/resources/documentation/WindowsServ/2003/standard/proddocs/en-us/Default.asp?url=/resources/documentation/WindowsServ/2003/standard/proddocs/en-us/cl_as_viewapps.asp

Summary

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

 

Posted: Sep 21 2004, 06:16 PM by OWScott | with 12 comment(s)
Filed under:

Comments

TrackBack said:

# September 22, 2004 6:28 AM

TrackBack said:

# September 22, 2004 6:29 AM

TrackBack said:

^_^,Pretty Good!
# April 10, 2005 9:38 AM

TrackBack said:

^_~,pretty good,18showsseeoo!
# April 18, 2005 10:40 AM

John said:

worked for me!  Thanks!

-now, how do I make my default app pool not use so much memory?

# November 27, 2006 3:50 PM

Refiance said:

Hello, this great idea - Debt Consolidation.

Use this link, and be happy!

[url=http://refiance.cpa-site.com/refiance/home-equity-loan-refinance-credit.html]refiance[/url]

[url=http://tempurpedic-mattres.page.tl]tempur-pedic mattresses[/url]

[url=http://tempur-pedic.myblogvoice.com]tempur-pedic mattresses[/url]

[url=http://www.maraments.hostinplace.com/rascal-flatts/rascal-flatts-lyric.htm]rascal-flatts-lyric[/url]

[url=http://webblog.nyit.edu/manila/gems/adult/adultfriendfindersexual.html]adult friend finder sexual[/url]

# May 9, 2007 10:15 PM

Mirrored Blogs said:

With VS 2003 and SPS 2003/WSS2.0, it was totally different. There was just one w3wp process you need

# October 1, 2007 8:07 AM

Which w3wp.exe process belongs to which App Pool in IIS6 « anuraj said:

Pingback from  Which w3wp.exe process belongs to which App Pool in IIS6 « anuraj

# November 9, 2007 6:59 PM

ASPInsiders said:

Perfmon is a great tool for mining performance data on a server and has a slew of objects and counters

# December 21, 2007 4:06 PM

SP1 RC to SP1 RTM Upgrade « Ian Blyth - System Center Technologies said:

Pingback from  SP1 RC to SP1 RTM Upgrade « Ian Blyth - System Center Technologies

# February 28, 2008 9:30 AM

Which web site belongs to the w3wp process « Brad Marsh’s Weblog said:

Pingback from  Which web site belongs to the w3wp process « Brad Marsh’s Weblog

# July 18, 2008 1:50 AM

  Application pool and the process of correspondence between W3WP.exe by Free Article For You said:

Pingback from    Application pool and the process of correspondence between W3WP.exe by Free Article For You

# July 31, 2008 11:12 AM