<

Go Premium for a chance to win a PS4. Enter to Win

x

Debug Tools to analyse IIS process

Published on
11,755 Points
4,455 Views
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.

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

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

Author Comment

by:pramodsk40
why is this neglected ?
0
 

Expert Comment

by:mandava308
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
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Join & Write a Comment

In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…

Keep in touch with Experts Exchange

Tech news and trends delivered to your inbox every month