IIS: How to figure out which site is consuming memory/CPU

On a Windows Server with many sites running on it all in their own process, I can see in task manager all the processes running with the various amounts of ram being used for each but I can't easily associate PID with Application Pool; how can I figure out which site is consuming memory/CPU ?

Internet Information Server 5.0
Each site that is set to Out Of Process will spin up a new instance of dllhost.exe; the trick to find out which dllhost.exe matches which site 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 spin up is the Process ID (PID). Using Task Manager, you can tell the memory and CPU.

Internet Information Server 6.0
Every application pool will create a w3pwp.exe process; iisapp.vbs is a script already placed in %systemroot%\system32 on Windows Server 2003 that reports the process identifiers (PIDs) of currently running w3pwp.exe processes serving a particular application pool as the following example:
W3WP.exe PID: 2232 AppPoolID: DefaultAppPool
W3WP.exe PID: 2608 AppPoolID: MyAppPool

All the script parameters and other useful information about it are located here
Tags:

About author

Vittorio Pavesi