Use Performance Monitor log files to track your IIS processes
This month, I show you how to troubleshoot situations in which your server is sluggish or unresponsive because of high CPU utilization. When a server's CPU or CPUs are working at or above 80 percent to 90 percent utilization, applications on the server can become sluggish or stop responding completely. When this situation occurs, you need to determine which process is monopolizing the CPUs.
To find the problem process, open Task Manager and click the Processes tab to see a list of running processes, like the one that Figure 1 shows. (You can click the CPU column header to sort the list of processes by their CPU utilization.) Make a note of which process is monopolizing the CPU time. If IIS is causing the problem, the offending process will be inetinfo.exe or the out-of-process (OOP) executable dllhost.exe (Windows 2000) or mtx.exe (Windows NT 4.0). If you use Microsoft Indexing Service, cidaemon.exe might explain the high CPU utilization. This process builds and updates the Index catalog and typically uses a lot of CPU time. However, cidaemon .exe is also set to run at a low priority, so it usually doesn't degrade the performance of the system even if it's at a high CPU level. If any other process is monopolizing the CPU, the problem is most likely not related to IIS.
When you know which process is causing the problem, you can gather more information about that process. The following steps should help you obtain the information you need. These steps assume you've already installed the debugging tools I've mentioned in previous articles in this series. For debugger installation instructions, see "Starting the Troubleshooting Process," June 2001, InstantDoc ID 20594. The steps also assume that you've downloaded two additional filesdebug.dll and debug.pdbfrom the Code Library on the Windows Web Solutions Web site (http://www.windowswebsolutions.com), installed them, and copied them to your default scripts directory. You need debug.dll and debug.pdb if you want to peg the CPU (i.e., cause the CPU to perform at 100 percent utilization) and follow along with the steps in this article. You don't need the files to troubleshoot an actual high-CPU-utilization problem. Make sure that the scripts virtual directory is running in process.
Collecting Performance Information
Open Performance Monitor on the server, and create a Performance Monitor log file. To do so on a Win2K server, follow these steps:
- Expand the Performance Logs and Alerts node.
- Right-click Counter Logs, then select New Log Settings.
- Enter a descriptive name for the log file.
- Note the log file locationyou'll need to know it later. (If you want to change the file's location, you can do that after you add the performance objects below.)
- Select All Counters and All Instances.
- Select the following items from the Performance object drop-down list, being sure to click Add after each selection: Active Server Pages, Memory, Process, Processor, Thread, Web Service, Internet Information Services Global.
- Click Close.
- Change the interval to 10, then click OK.
To create a Performance Monitor log file on an NT 4.0 server, follow these steps:
- Select Log from the Options menu.
- Set the location and name of the log file.
- Change the interval to 1 (for 1 second).
- Click Save.
- Click the plus sign (+) on the toolbar.
- Add the following objects: Active Server Pages, Memory, Process, Processor, Thread, Web Service, and Internet Information Server Global.
- Click Done.
- Select Log from the Options menu.
- Click Start Log.
After you've created the log file, let the server run for 1 to 2 minutes. Then, open a browser and type
http://localhost/scripts/debug.dll?CPU
to begin pegging the CPU. Your system will run very sluggishly during the pegging process.
charlie September 26, 2003