[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More


Debug Tools to analyse IIS process

Published on
12,037 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

The Five Tenets of the Most Secure Backup

Data loss can hit a business in any number of ways. In reality, companies should expect to lose data at some point. The challenge is having a plan to recover from such an event.

Join & Write a Comment

Did you know PowerShell can save you time with SaaS platforms? Simply leverage RESTfulAPIs to build your own PowerShell modules. These will kill repetitive tickets and tabs, using the command Invoke-RestMethod. Tune into this webinar to learn how…
Check How effective MS Exchange Expert thinks Exchange Mailbox Recovery by SysTools IS. Visit the Official site to get detailed information:- https://www.systoolsgroup.com/exchange-recovery.html (https://www.systoolsgroup.com/exchange-recovery.h…

Keep in touch with Experts Exchange

Tech news and trends delivered to your inbox every month