A Place for C Sharpers/.Netters

I Will do coding till last moment of life-Kiran Patil

Posts Tagged ‘IIS’

How to calculate bandwidth used by website hosted in IIS?

Posted by kiranpatils on September 17, 2008

Problem With Solution:

I need to calculate total bandwidth consumed by a website daily which is hosted on IIS. I was thinking to use urchin but can’t make it. Then after some googling I found the way and here it is:

  1. IIS Log files. Stored on

IIS 6.0 and later have request logging enabled by default. The default location for these logs is:

IIS 6.0: %windir%\System32\LogFiles\W3SVC<SiteID>

IIS 7.0: %systemDrive%\Inetpub\logfiles

2. Log Parser 2.2 – A versatile tool by micro. For fetching information from log files [I have used its COM component LogParser.dll]

So you want some reference:

Here are the good links which I would like to share:

http://microsoft.apress.com/asptodayarchive/73567/accessing-iis-log-information-to-analyse-site-metricsBasic about configuring Log files.

http://www.microsoft.com/downloads/details.aspx?FamilyID=890cd06b-abf8-4c25-91b2-f8d975cf8c07&displaylang=enLog parser tool for download.

http://www.msexchange.org/tutorials/Using-Logparser-Utility-Analyze-ExchangeIIS-Logs.html good article for Log parser introduction.

http://www.microsoft.com/technet/prodtechnol/WindowsServer2003/Library/IIS/676400bc-8969-4aa7-851a-9319490a9bbb.mspx?mfr=trueW3C Log file format.

http://books.google.co.in/books?id=vnIXo-yUT2gC&pg=PA45&lpg=PA45&dq=bytes+sent%2Bbytes+received/time+taken&source=web&ots=B3-yyUy3Ua&sig=j9VrhIVukqsIZC2KW8kwrX3eZxY&hl=en&sa=X&oi=book_result&resnum=2&ct=result#PPA46,M1Really Great book you must have this [Don’t miss Page # 57]

http://www.codeproject.com/KB/recipes/SimpleLogParse.aspxHow to create program using COM Component. [C#.NET]

http://blogs.iis.net/chrisad/archive/2006/07/13/Chris.aspx More on Log parser

http://www.iis.net/default.aspx?tabid=2&subtabid=26&i=36 — PPT

Try to implement it…if don’t make out of it do write me comment I will post my sample project here…so you can quick start….but don’t write comment without trying…it will be good fun!

What other things you can achieve using it..

  • Top browsers accessing your Websites
  • Hits by Hour
  • Request by URI
  • Top 10 Images by Size
  • Top 10 URLs for a website with some interesting data to support you
  • Top 20 clients using your website
  • Status code
  • And you can also generate Charts.

ALL THE BEST!!

Posted in ASP.NET, IIS | Tagged: | 2 Comments »