Debug slow calls using IIS Logs

For any asp.net/WCF application hosted on IIS it is essential to monitor the response times of the web requests and the easiest way to do this is by using IIS logs. I use Log analyzer to output the calls taking a lot of time. Following steps would help you do it yourself and be an expert in monitoring your own performance. It is important to prove your point with statistical data.

Download following tool to analyze the IIS Logs -

LogAnalyzer -

http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=24659

 

And you need to run queries to query the avg time taken and response time.

 

Example query for avg response times -

 

LogParser -i:IISW3C "SELECT cs-uri-stem, AVG(time-taken) As AvgTime FROM C:\inetpub\Logs\*.log GROUP BY cs-uri-stem"  - Replace the log path

 

Example query for response time for a resource-

 

LogParser -i:IISW3C "SELECT cs-uri-stem, COUNT(*) As Hits FROM C:\inetpub\Logs\*.log WHERE EXTRACT_FILENAME(cs-uri-stem) = 'sample.ashx' AND sc-status = '200' GROUP BY cs-uri-stem"

And you can output the report and expose it online via IIS.

With this I hope each one of you can easily debug problems in production.

 

I found this link quite useful for writing simple queries -

http://www.praveenmodi.com/parsing-iis-logs-with-logparser-22/

 

 

3 Comments

Comments have been disabled for this content.