What is Trace Diagnostics 1.0? Why you should care? How useful it *just* might be...Resources

 

Introduction

Trace Diagnostics 1.0 is a pretty useful, yet undiscovered, utility that ships as part of the IIS Diagnostics Toolkit.  It was a grass-roots type of tool that came about for various reasons, one of which was political and another because of customer feedback.  Let's take a quick trip...

It is June 2005, sunny Orlando, FL. and it is TechEd 2005.  A developer on our IIS team, Jaro as we "call" him, is working the Microsoft Pavilion.  During this required scheduled shift, he gets some customer requests from customers who ask why they can't see requests in-flight while they are processing.  Jaro is perplexed because he knows that he just got done checking in code for Service Pack 1 that is called "IIS:  Request Monitor" so he is slightly perplexed.  That evening, a colleague of mine was preparing for her presentation and she was stuck on getting a particular demonstration to work and she was frustrated.  She called and asked if she could drop by and get some help and I said sure...(she thought I was the expert, but little did she know that I had the developer in my room and I knew we could figure the problem out with him there.) 

In August 2005, nesseled in our little pad here in Redmond, Wa., Jaro drops by my office grinning from ear-to-ear.  I was slightly surprised what the occassion called for but I only hoped it was something good that didn't include any jokes and\or blackmail of me (the team likes to find some damming evidence of me and later use it)...To my surprise, he points me to a share on his machine and there sits a executable called IIsReqVwr.exe.  I copied it over, as he advised, and then he said make a request to IIS on my server...I said sure.  I created some load using WCAT against an application that causes some long running requests to execute and then executed IIsReqVwr.exe as he instructed.  "Wow...," I remember saying later.

Fast forward to January 2006 whereby we released the 2nd edition of the IIS Diagnostics Toolkit - ironically called "IIS Diagnostics Toolkit - January 2006" to the web.  This toolkit offered an extension of a few tools already released and introduced a few new ones...of course, all aimed at helping customers get insight to what is occurring on their IIS servers. 

What is Trace Diagnostics 1.0?

The birth of Trace Diagnostics 1.0 (TraceDiag) was truly born out of direct feedback from customers.  That feedback was no other than Enterprise Tracing for Windows (ETW) was too difficult to setup, configure, and use.  As a user, I would have to agree.  This caused a developer to lock himself in his office and bang out a tool aimed at making life slightly easier for customers.  TraceDiag has multiple parts, of which IIS Request Viewer, is owned by Jaro & I.  The other aspects of this "toolkit" is IIsReqMon.exe & IIsTrace.exe.  The combination of these tools give a complete experience for simplifying using IIS 6.0's tracing.  This feature became powerful and robust with the release of Service Pack 1.

To download TraceDiag 1.0, do one of the following:

If you are using Windows NT 4.0 Server, Windows 2000 Server, Windows XP Professional, or Windows Server 2003 RTM, then you will not have the option to install Trace Diagnostics as part of the entire toolkit or stand-alone.  It will return an error indicating that you must have Windows Server 2003 Service Pack 1 installed as the tools will use features that were not available prior that this version of Windows.

Thus, install Service Pack 1 ... then continue.

Why you should care?

The particular piece I will focus on is IIS Request Viewer.  This is the user interface piece of toolkit and is very, very simple to use.  It will create a User Interface that shows you all currently running Application Pools, threads, as well Currently Executing Requests per apppool.  The method it creates this coolness isn't magic or voodoo, but instead simply using the underlying ETW commands to create, start, refresh, and stop traces.  For example, you can do everything that Request Viewer is doing by issuing the following command:

logman start MyRequests -p:"IIS:  Request Monitor" -ets

However, the great thing that IIS Request Viewer offers is that it doesn't require you to do all of this along with stopping the data, then formatting it using a tool such as Log Parser.  Nah, it just starts with the couple of clicks of the mouse...

How Useful it just might Be

It goes without saying that troubleshooting is a art more than a science.  Each troubleshooter has a different, yet often effective, means of approaching and solving complex problems.  However, every troubleshooter in the world will always tell you that if you can determine what is occuring at the exact moment the failure is occurring, well then you might very well be half-way to the solution.  This is exactly what IIS Request Viewer offers is the ability determine what requests are running, as well as data about each request that can truly help you.  The information that IIS Request Viewer will give you is the following:

  1. Request Id:  This is the unique, 32-bit value, given to each request as it moves through the request pipeline in IIS 6.0
  2. Client IP:  This is the client's IP address for which this request is made on behalf of
  3. State:  This is the current location within the IIS pipeline where the request is currently located.  For example, in an ISAPI extension such as ASP.dll or ASPNET_ISAPI.dll.
  4. Time:  This is the currently measurable time that the request has been running.  This is *total* time since the request started, as opposed to the amount of time currently in that State

How do I start IIS Request Viewer?

This is simple with a couple of clicks of the mouse.  By default, all tools are installed to Programs, and into IIS Diagnostics folder.  The physical location, though, is in %programfiles%\iis resources\{toolname} so don't be confused.  To start the Request Viewer, simply navigate to All Programs --> IIS Resources --> TraceDiag --> Request Viewer -->  IIS Request Viewer.

How do I start a new Trace Session?

To start a new session, you can use the File Menu or simply click the Start New Trace button located on the toolbar.  When you have successfully started the trace, you will see a list of AppPools & the PID in the tree menu on the left.  You can expand the AppPool section to see more specific information such as used threads, unused threads, etc. 

On the right-hand side, when you have started a trace session you will see a list of currently running requests.

Resources

The following is a list of helpful resources to help familiarize with the underlying ETW technology, as well as more about tracing IIS 6.0.  I will add to these as I get more useful ones that come along...

Microsoft.com Operations Introduces Real-World Debugging:

Tomorrow:

No Comments