How to calculate bandwidth used by website hosted in IIS?
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:
- 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-metrics — Basic about configuring Log files.
http://www.microsoft.com/downloads/details.aspx?FamilyID=890cd06b-abf8-4c25-91b2-f8d975cf8c07&displaylang=en – Log parser tool for download.
http://www.msexchange.org/tutorials/Using-Logparser-Utility-Analyze-ExchangeIIS-Logs.html — good article for Log parser introduction.
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,M1 – Really Great book you must have this [Don’t miss Page # 57]
http://www.codeproject.com/KB/recipes/SimpleLogParse.aspx — How to create program using COM Component. [C#.NET]
http://blogs.iis.net/chrisad/archive/2006/07/13/Chris.aspx — More on Log parser
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!!