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/

 

 

Comments

# Debug slow calls using IIS Logs | ASP.NET | Syngu

Saturday, January 07, 2012 1:42 AM by Debug slow calls using IIS Logs | ASP.NET | Syngu

Pingback from  Debug slow calls using IIS Logs | ASP.NET | Syngu

# re: Debug slow calls using IIS Logs

Saturday, March 31, 2012 1:28 AM by Rajan

Excellent Article.

# re: Debug slow calls using IIS Logs

Friday, December 21, 2012 8:00 AM by Foote

I was reading some of your content on this website and I conceive this internet site is really informative !

Keep on putting up.

# re: Debug slow calls using IIS Logs

Tuesday, January 08, 2013 4:38 AM by Salmon

Thanks for the great post on your blog, it really gives me an insight on this topic.

*~“: