Debug Tools to analyse IIS process

Published on
11,926 Points
3 Endorsements
Last Modified:
Debug Tools to analyse IIS process:

This article focus on taking memory dumps from IIS to determine which code is taking more time and to analyse which calls hangs/causes more CPU usage.

To take dumps,download the following.

Install1: To start with you need to download the debugging tools which can be found at http://msdn.microsoft.com/en-us/windows/hardware/gg463016. Install it on the machine(webserver) where application is running in IIS to take dumps.

Install2: Download symbols from http://msdn.microsoft.com/en-us/windows/hardware/gg463028 and install or you can copy to shared path.

Steps to take dumps:

Step1: Get the process ID for the IIS worker process. You can get either from taskmanager and selecting PID to get it or Run IISapp from C:\<windowsdirectory>\System32.

Step2: Adplus will take dump at current state of CPU/IIS process. Make sure to take dumps when CPU is very high. Now goto path where you installed debugging tools earlier.i.e(C:\Program Files\Debugging Tools for Windows (x86)). Here we need to run adplus command. Example(C:\Program Files\Debugging Tools for Windows (x86)>adplus.vbs -hang -p 492) 492 is process id from step1.

Result: This will create the dump in same path with date and timestamp. The directory contains the dmp file, txt file, adplus report, process list with PID appended.

Steps to analyse the results:

Now that we have taken dumps you can analyse on the same machine or on different machine.

Step3: Goto Start->Program files->Debugging tools for windows(x64) and open WinDbg. It will open the Dump editor.

Step4: Goto File -> select Open Crash Dump and select the dmp file taken from Step2.It will open the small command window and will have command box to type.

Step5: You need to load symbols from Install2(from above)i.e C:\symbols or \\sharepath\symbols.
Type in small command window: .sympath+ C:\symbols
To load symbols Type:  .reload
To load mscorwks lib Type:  .loadby sos mscorwks
To display time consumed by each thread Type: !runaway
Output will be something like this...
 0:000> !runaway
 	User Mode Time     Thread  Time
 	92:25b0          0 days 0:01:43.546
 	96:2418          0 days 0:01:39.796
 	22:2314          0 days 0:01:39.671	

Open in new window

Now to check the thread which hangs/causes high cpu Type: ~92s
To view the calls Type: !clrstack  this will display all the methods/call from the code which is running at that point of time.You can further analyse the code for optimization.

Some of the commands which can be helpful.

!Analyze -v
_NT_SYMBOL_PATH=SRV*C:\MyLocalSymbols*http://msdl.microsoft.com/download/symbols  - to set symbols
!help - will give all the commands.

Cheat sheet for the commands can be found @ http://geekswithblogs.net/.netonmymind/archive/2006/03/14/72262.aspx
LVL 10

Author Comment

why is this neglected ?

Expert Comment

Hello Pramod i am looking for desperate help on IIS could you please email your contact details to my email ID indian803@gmail.com i wil ltouchbase with u

Featured Post

Cloud Class® Course: Python 3 Fundamentals

This course will teach participants about installing and configuring Python, syntax, importing, statements, types, strings, booleans, files, lists, tuples, comprehensions, functions, and classes.

Join & Write a Comment

In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…
There may be issues when you are trying to access Outlook or send & receive emails or due to Outlook crash which leads to corrupt or damaged PST file. To eliminate the corruption from your PST file, you need to repair the corrupt Outlook PST file. U…

Keep in touch with Experts Exchange

Tech news and trends delivered to your inbox every month