Application pools and Windows processes

IIS6 uses application pools, where a server process named w3wp.exe services requests for a collection of web sites. Which sites are in which application pool is set as a site property. You can determine easily enough which sites are in each pool from IIS Manager, but what if you need to know which Windows process an application pool is running under? Hint: the processes are all named w3wp.exe. :)

Fear not young padawan, there is a handy little script included that will tell you just that. Drop to the command line and enter cscript %windir%\system32\iisapp.vbs (although you may be able to just enter iisapp.vbs depending on server configuration). So for example iisapp.vbs | sort would give you output like this:

W3WP.exe PID: 1088   AppPoolId: ASP2C-AppPool
W3WP.exe PID: 1356   AppPoolId: ASP1C-AppPool
W3WP.exe PID: 1800   AppPoolId: ASP2A-AppPool
W3WP.exe PID: 2356   AppPoolId: ASP1A-AppPool
W3WP.exe PID: 4148   AppPoolId: ASP1-CCApp-AppPool
W3WP.exe PID: 4484   AppPoolId: ASP1-Jobs-AppPool
W3WP.exe PID: 4820   AppPoolId: ASP1-Purchased-AppPool
W3WP.exe PID: 5020   AppPoolId: ASP2B-AppPool
W3WP.exe PID: 5964   AppPoolId: ASP1B-AppPool

You can see the Windows PIDs for each process using the command-line utility tasklist, or customize the Windows Task Manager to display the PID. For example, tasklist | find “w3wp.exe” | sort will yield something that looks like this:

w3wp.exe                      1088 Console                    0    121,956 K
w3wp.exe                      1356 Console                    0    160,040 K
w3wp.exe                      1800 Console                    0    170,408 K
w3wp.exe                      2356 Console                    0     53,264 K
w3wp.exe                      4148 Console                    0     38,592 K
w3wp.exe                      4484 Console                    0    119,088 K
w3wp.exe                      4820 Console                    0     18,380 K
w3wp.exe                      5020 Console                    0     13,604 K
w3wp.exe                      5964 Console                    0    138,344 K

This can come in particularly handy when you have a process out of control and need to know which application pool is in trouble.

This entry was posted in Microsoft Windows. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s