ASP.NET Tips: What to gather to troubleshoot – part 1 – High CPU or Hang

On machines running IIS5 and IIS5.1, these are the Inetinfo.exe, DLLHost.exe and/or ASPNET_WP.exe processes. On machines running IIS 6 or 7, this is the w3wp.exe process.

The following steps will allow us to get log files of the processes hosting the IIS or ASP.NET applications, as well as obtain the thread ID that is using the CPU that will directly correspond to the log file. Please let us know if you have any questions about using this process.

Before the issue occurs

A. Download DebugDiag:
======================

  1. Install the Debug Diagnostic tool
  2. The default installation location for the package is C:\Program Files\IIS Resources\DebugDiag. It can be changed.
  3. Make sure any other monitoring and debugging tools are not running.

B. Create a Performance Monitor log:
====================================

  1. In Performance Monitor, expand Performance Logs and Alerts
  2. Right Click on Counter Logs
  3. Choose New Log Settings...
  4. Enter a descriptive name
  5. Note the log file location for later (or go to the Log Files tab and change the location)
  6. Click the Add Counters button
  7. Click the All Counters radio button.  Click the Select instances from list radio button, and select the process hosting the IIS or ASP.net application.  On Windows 2000 and Windows XP, this will be inetinfo, dllhost, or aspnet_wp .  On Windows 2003 and Windows 2008 this will be w3wp.  NOTE: It is possible you will see multiple instances of dllhost on IIS5/5.1 or w3wp on IIS6/IIS7 in the list of available processes.  If you do, or if you are unsure of which process to monitor, please cltrl-click to multiselect all of the available IIS/ASP.net choices.
  8. If the application is not an ASP.net application, select the following from the Performance Object dropdown, being sure to Add each one as you select it:
    • Process
    • Thread

    If the application is an ASP.net application, select the following from the Performance Object dropdown, being sure to Add each one as you select it:

    • Process
    • Thread
    • .NET CLR Data
    • .NET CLR Exceptions
    • .NET CLR Interop
    • .NET CLR Jit
    • .NET CLR Loading
    • .NET CLR LocksAndThreads
    • .NET CLR Memory
    • .NET CLR Networking
    • .NET CLR Remoting
    • .NET CLR Security
    • ASP.NET
    • ASP.NET Applications
  9. Click Close
  10. Click OK

For the ASP.NET counters, select the version that you are wanting to monitor.  Ex.  For 1.1 framework, select ASP.NET v1.1.4322 and ASP.NET Applications v1.1.4322.

IMPORTANT: The Data Sampling Interval and time to start monitoring is subjective to when the CPU spike reproduces. Due to the log size, monitor the server to gather the needed data while not overwhelming the server.

Note: For more information on Performance monitor, see http://support.microsoft.com/?id=248345

After the issue occurs

A. Let the process run
======================
Now let the server run for a few minutes to document the environment in which the high CPU/hang is occurring in.

B. Capture the memory Dumps
===========================

  1. Launch DebugDiag
    • Start, Program Files, IIS Diagnostics, Debug Diagnostics, Debug Diagnostic Tool
  2. From the Tools menu, select Create IIS Hang Dump

Repeat Step 2 every 1 - 2 minutes until you have 3 sets of memory dumps. Make sure the previous memory dumps completed before continuing to capture the next set of memory dumps. The multiple memory dumps will allow us to see if the process is progressing during the hang/high CPU symptoms or whether the process is actually performing work.

Files will be created in the following path by default:
C:\Program Files\IIS Resources\DebugDiag\Logs\Misc

C. Stop the Performance Monitor log
===================================

In Performance Monitor:

  1. Right click on your log that is now listed under Counter Logs
  2. Choose Stop Log

kick it on DotNetKicks.com

Published 02 May 08 12:13 by Tom

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Comments

# molotov said on May 2, 2008 2:12 PM:

>> The default installation location for the package is C:\Program Files\IIS Resources\DebugDiag <<

In the install I just completed, it was C:\Program Files\DebugDiag\.

# Tom said on May 2, 2008 2:24 PM:

Molotov,

Very true.  IIS Resources was used with DebugDiag 1.0.  So what you list is the correct folder for 1.1

# gOODiDEA.NET said on May 3, 2008 1:05 AM:

.NET Microformat.net - a .net based flexible Microformat Parser Remote Desktop Client Wrapper For RDP

# gOODiDEA said on May 3, 2008 1:06 AM:

.NETMicroformat.net-a.netbasedflexibleMicroformatParserRemoteDesktopClientWrapperFor...

# Sean said on May 5, 2008 12:05 PM:

I'm installing  a new widows XP Pro system and only see the inetinfo and the dllhost processes.  What I wamt to see is the aspnet_wp process but don't.  What is the circumstances necessary to see that file?

Thanks!

# Sean said on May 5, 2008 12:37 PM:

The problem was in the machine.config.  This post helped me:

So your machine is WINXP sp2 /IIS5.

Currently, I'd suggest you first try changing your ASP.NET's running

process's  Account from default machine\aspnet to the LOCALSYSTEM to as to

make sure whether this is a permission problem of the asp.net process

idenitity. To change the process identity, you can follow the below steps:

1. locate the machine.config file under your .NET framework 2.0's intalling

folder like:

C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\CONFIG

2. Open the machine.config file and find the <processModel> element, by

default it is configured as:

<processModel autoConfig="true" />

, we need to change it to below:

<processModel autoConfig="true" userName="System"/>

so as to let the ASP.NET worker process running under the local system

account(which has the most powerful permission and privileges on local

system...)

3. Restart IIS through  "iisreset" command

Then, test your asp.net 2.0 applicaiton again to see whether it can

works......

Also, this is just for testing only, generally we do not recommend asp.net

process running under local system account. Also, the machine.config's

<processModel> element is used for IIS5 isolate model. For IIS6/win2k3

server, it by default use applicaiton pool model which is different from

this.

Anyway, please have a try to see whether it works and feel free to post

here if there're anything unclear...

Thanks,

Steven Cheng

Microsoft Online Support

# Useful IIS/ASP.NET Information provided by Microsoft Support Teams said on May 6, 2008 10:57 AM:

Here are last weeks updates to the ASP.NET Debugging blog: Code Gallery and CodePlex, how are they different

# ASP.NET Debugging said on May 8, 2008 1:26 PM:

We got some really good answers to this quiz.&#160; I am going to give my answer but it isn’t the only

# ASP.NET Debugging said on May 21, 2008 11:39 AM:

So now that I am done with all the individual posts, I thought I would wrap them all together.&#160;

# bmassicotte said on July 13, 2008 11:21 AM:

If your just looking to see what file is executing and what app pool it is under use IISPeek. It will tell you all this is a few seconds. Google it to find it on the net.

Just a thought.. It worked for us.

# Codex73 said on July 30, 2008 12:15 PM:

IISPeek will only work on Windows 2003 or Windows 2008 Servers.

# bmassicotte said on August 4, 2008 9:20 PM:

Yes, it only works with those and Vista. (but who is using Vista for a web server...) Sorry for not clarifying earlier. If you are using one of the supported platforms, IISPeek will do all the manual gathering for you. If not, it can't help.

Best of luck!

Leave a Comment

(required) 
(optional)
(required) 

Search

Go

This Blog

Syndication

Page view tracker