Page 1 of 1

Measuring bandwidth output to a folder

Posted: Thu Dec 30, 2004 11:13 pm
by genetix
I'm working on a new file management system and I have run into a fork!

I can either count my clients "bandwidth" by page views or actual bandwidth. I have decided to use both(having it differ between hosting packages for beginners or experts).

Whats the easiest way to track the bandwidth on a folder? My clients each have a root folder(their username) on my hosting section of my webserver. Is there a program available which sits in the background on my server and monitors specified folders?

Posted: Thu Dec 30, 2004 11:22 pm
by genetix
I was just snooping through my Apache logs and found a very easy way to count page views without adding scripts to every page a client has. Is there a way I can multiply the size of a page by how many times its view to get bandwidth or is that way off the island?

(Sorry about refering to an island but right now it has been blizarding literally ALL day and I can't keep the 4 foot snow bank off my driveway. I shovel every 3 hours and it takes me 2 hours to get rid of all the snow. Thank god for neighbours who have enough snowblowers that they do the street on the way to my house....)

Posted: Thu Dec 30, 2004 11:26 pm
by feyd
I think that's how most of the other bandwidth analyzers work (outside of creating a plugin for the server, but then it's more and more specialized. :)

Posted: Thu Dec 30, 2004 11:49 pm
by genetix
Do you know of any places that may have documentation on how its done? I'm guessing its probably not just a matter of multiplying page views by page size. That would seem to simple...

Thanks for the quick reply to! Your everywhere man its AWSOME! Thanks for the help in advance.

Posted: Fri Dec 31, 2004 12:03 am
by shiznatix
i smoke crack rocks

Posted: Fri Dec 31, 2004 12:28 am
by feyd
wonderfully informative shiz. :?

what I would do is using the expanded access log file, I'd group the uri's requested and sum each of their bytes sent information.. instead of multiplying (since the size of uri's can change quite easily, esp on a php'd site..:))

Posted: Fri Dec 31, 2004 2:29 am
by Chris Corbyn
Yeah shiz... you just couldn't contain telling us that?

Enjoy ;-) LOL :P

Posted: Fri Dec 31, 2004 4:52 am
by kettle_drum
Yeah you will want to just count the transfer sizes in the apache logs, as if you just multiply the page hits by page size you cant take into account that certain images and css files will be in cache.

Posted: Fri Dec 31, 2004 12:34 pm
by genetix
What file does Apache store the information in? I'm guessing its under the apache logs folder in the file access?

If it is under the access file what column is it in?

Posted: Sat Jan 01, 2005 12:45 am
by feyd
the ~standard log I have has a quoted string (preceeded by the timestamp) that contains the http request. After that is the http response code sent back. The number following this is the bytes sent back. Beware that when no content is sent back, Apache typically will place a dash (minus) instead of zero. Also beware that the bytes sent is content only. Not header information, packet sizes or anything to that fact. So your numbers will be off unless you start tracking your header sizes too.. :)

Posted: Sat Jan 01, 2005 4:02 am
by carlmcdade
The easiest way that I know of to get Apache/webhost to correctly measure traffic to a folder is to set a subdomain name to that folder using cpanel or the like.

Posted: Sat Jan 01, 2005 9:01 am
by genetix
carlmcdade wrote:The easiest way that I know of to get Apache/webhost to correctly measure traffic to a folder is to set a subdomain name to that folder using cpanel or the like.
I'm using this for my own control panel though. Thats the problem.
http://www.webdummy.net/serverpro/login.php
username: demo
password: demo

Posted: Sat Jan 01, 2005 9:54 pm
by genetix
It turns out this is going to be a lot harder than I though with my current setup.

Are there any programs that "stand behind" apache and logs activity? What do other systems like CPanel or Plesk use?

*EDIT*
I found a few programs to detect bandwidth but I couldn't find any that watch the bandwidth output on a group of root folders.

To make matters worse I need to be able to add users from a internet script(admin part of my control panel). I also need one that logs the bandwidth in a txt or ini file so I can select it.

I'm starting to think I may need to ask a friend a REALLY big favour...