HTTP Handler for bandwidth monitoring? RRS feed

  • Question

  • User1856707430 posted
    I would like to create an HTTPHandler to monitor the bandwidth of all my domains on my server, is it the correct approach? or ISAPI filters are more correct for this? Can I monitor all requests (.jpg,.swf,.gif, etc.) or just .aspx? And how would I know the size? If you have an article on how to do this it would be good. Thanks in Advance
    Friday, May 28, 2004 2:28 AM

All replies

  • User-614773675 posted
    Hi, Hope This Helps: Use an HttpHandler to stop bandwidth leeching of your images
    Friday, May 28, 2004 4:21 AM
  • User-1645088262 posted
    I think for monitoring the bandwidth, a HttpModule would be better. Just check and keep track of the content-length in the right place. We've done this to provide some in-built stats for a compression module (reporting the compressed and non-compressed sizes).
    Friday, May 28, 2004 6:04 AM
  • User1088344998 posted
    That's pretty cool Colt. Thanks for the post. I can definately see a need for that.
    Friday, May 28, 2004 4:38 PM
  • User1856707430 posted
    I was reseraching and I found Log Parser that comes with IIS resource kit. http://www.microsoft.com/downloads/details.aspx?familyid=56FC92EE-A71A-4C73-B628-ADE629C89499&displaylang=en I think that a better approach will be an app that analyze the log files and put them on SQL server. Then I can get reports from there (stats for clients), and also develop an http handler to query SQL on each request, if the client has Exceeded his bandwidth, I just redirect to another page. Anyone has the structure of a database for web statistics?
    Friday, May 28, 2004 5:00 PM
  • User-614773675 posted
    Hi emiliodabdoub and Jason, Speaking of Log Parser, Roy have 2 good blogs in this subject: - http://msdn.microsoft.com/asp.net/default.aspx?pull=/library/en-us/dnaspp/html/regexandxmlclasses.asp - http://weblogs.asp.net/rosherove/archive/2004/01/10/49441.aspx :) Regards, Colt
    Sunday, May 30, 2004 9:08 AM
  • User-752640476 posted
    That's a good trick, Colt. The only problem I can see, is that for those of us who do not have control over the server configuration (shared hosting) we can't just go and remap the .jpg/.gif or whatever to the aspnet_isapi.dll whenever we want. There must be a way to do it from just your own website (not worried about bandwidth leaching)... I'm more concerned about keeping track of bandwidth in general for the site and for each user. Thanks, Shawn
    Wednesday, June 2, 2004 12:36 PM
  • User1297008538 posted
    Shawn, What about writing an HttpModule which would reside in the machine.config, and in the App_EndRequest, checking the size of the OutputStream object?
    Monday, June 28, 2004 1:50 AM