One of the things I like to blog about are the simple little tips and scripts that shave a few seconds of minutes off a simple task. As I’m working more and more with IIS7.5 in Windows Server 2008 R2, I’m finding ways to save more and more time.
Have you ever had an out of control IIS Worker Process and needed to know what application it is fast? The server CPU is maxed at 100% or the memory usage is peaking. You open up Task Manager and you see an AWOL w3wp.exe process.
The quickest method of identifying the application pool is to cross check the process’ PID (process identifier) against the appcmd.exe output. Fastest way is as follows.
Open task manager, click View > Select Columns:
Enable the PID column:
Reference the PID of the out of control w3wp.exe worker process (I know my example isn’t out of control but it makes my point):
Using appcmd.exe (C:\Windows\System32\inetsrv\appcmd.exe) one can run the following command:
However the inetsrv directory isn’t in the environmental PATH variable by default and the command is long-winded to type. I prefer the following method.
Every web server I logon to has a prepared “tools” directory where a collection of time saving scripts are kept. One of the many is the listwp.bat script:
Summary of commands:
- @echo off – Simply hides the following commands from the prompt when the batch file is run. Merely keeps things looking nice.
- C:\Windows\System32\inetsrv\appcmd.exe list wps – Prints to the screen a list of IIS worker processes that you can cross check the PID against an application pool.
You can simply now run this script to get the output you require:
So you know the PID, to locate the application pool, which you can use to identify the offending website or applications causing your server to overload.
- Automatically Clean Up Temporary ASP.NET Files
- What process is locking this file?
- What is sidebar.exe
- How to Stop sidebar.exe Using Lots of Memory (Edited 14 May 2011)
- Error message “The file is either corrupted or does not have the latest credentials associated with recovery service. (ID: 34513) “
- Google Chrome and NTLM Auto Login Using Windows Authentication
- How to delete ASP.NET temporary files from shared server
- ISAPI Filter ‘C:\Windows\Microsoft.NET\Framework\v4.0.30319\\aspnet_filter.dll’ could not be loaded due to a configuration problem