Monthly Bandwidth Monitoring/Tracking

Traffic

Does anyone out there have any experience with bandwidth tracking / monitoring?

Imagine a web server that is allotted a certain amount of bandwidth per month. That server hosts a number of different web sites (aka apache virtual servers), and needs to keep track of how much bandwidth each web site uses so it can either (a) charge individual websites for going over their monthly limit or (b) shut down their website when it goes over a certain limit.

I’ve been looking into a number of different solutions for this situation, and most of the information I can find through Google is … absurd. People suggest everything from installing bloated administrative control panels that do way more than I need, to upgrading to the Zeus web server (not free).

The two ideas I’ve come across that I thought might work are:

1. Custom Apache Module: I found this module that creates it’s own byte-log and shuts down apache service when it goes over a daily limit. This could be modified to work on a monthly basis and update some other external source that could be checked by a web-interface – and customers could be warned *before* problems arise.

2. Apache Log Parsing: I could write a program that works like webalizer, and simply parses apache access logs to determine bandwidth usage. It could run on a cron every night/hour/whatever and update a database with the results.

Does anyone else have any experience with this type of thing. Suggestions?

6 Responses to “Monthly Bandwidth Monitoring/Tracking”

  1. Michael Pierce

    good idea to figure that out before you offer a hosted solution of vanilla ;)

  2. David McKendrick

    mod_bwlimited & mod_log_bytes for the win.
    Anything beyond that would be overkill if it’s just for a few users, although in all honesty it doesn’t hurt to give users some sort of frontend (e.g. webmin) if you don’t want to be managing things on their behalf.

    I suppose it depends on who & what you’re working with.

  3. Mark

    Thank you so much for the response, David. I had almost given up on this post.

    I’m on a redhat server. Do you run cpanel, or did you get those mods separate from that (I’ve read that they’re a part of cpanel)?

    Do you know where I can get them?

  4. Wes Pomeroy

    Mark – did you ever find either of those modules? A Google search for ‘apache mod_log_bytes’ returns nothing (expect other people looking for it). I’m dealing with the exact same situation you describe in your post.

  5. Mark

    @Wes – No, I never did. I did a ton of research, and most of it left me quite frustrated. I have yet to resolve this issue. I’d be interested to hear how you overcome it when you do…

  6. Wes Pomeroy

    Mark – I too was unable to find anything concrete. It’s been a few months, but if memory serves I went low-tech, downloaded a freeware web log analyzer (AW Stats I think), and filtered by domain name. It’s not a very elegant long term solution, but for my immediate needs (estimating average monthy bandwidth per site), it worked out.

Leave a Reply