Time-Taken & W3C Logs: Turn it on...

The most valuable friend to an IT Professional or Developer who uses IIS is a little-bitty check-mark field that is not enabled by default.  This field is the red-headed stepchild of logging but one that plays so many friendly tunes for you to determine what requests are taking a long time.  The relative thing is “long time” in most environments as one’s long time might be 2 seconds while another’s is 10.

In either event, don’t lose site of how to do yourself right when the time comes to do some log “mining.”  Enable the time-taken field for W3C logging (if you are using this type).

User Interface:

  1).  Open IIS Manager (Start – Run – Inetmgr)

  2).  Right-click on the Web Sites tab (IIS 6 only — IIS 5 customers right-click on Server)

  3).  Choose Properties

  4).  On the General tab, select the Properties for Logging

  5).  On the advanced tab, scroll down and check “Time-Taken”

  6).  Click Ok, Ok

  7).  For the application pool where the code is being executed, right-click and select iisapp.vbs (SP 1 customers can use iisapp.vbs and view the application pools.  Then, use iisapp /p 1234 (for PID) /r (for recycle)

Command-Line:

adsutil.vbs set w3svc/LogExtFileTimeTaken 1

NOTE:  This sets it globally.  It will be inherited down where appropriate to each site.  If you prefer to enable only on one site, then use this syntax:

adsutil.vbs set w3svc/{site#}/root/LogExtFileTimeTaken 1

For a simple Log Parser query to find the top URI’s in time-taken (i.e. slow) then use this:

Logparser “select * from <filename> where time-taken > 10000 OrderBy cs-uri-stem”

Happy troubleshooting,

~Chris

1 Comment

Comments have been disabled for this content.