Anyone know how to best track bandwidth usage for a particular directory in a website? I've read that Wireshark can do this. Can anyone point me to instructions on how best to do that and then use a PHP script to read the bandwidth usage daily or monthly?
Thanks for your reply, Ken. I finally came to that same conclusion about Wireshark after researching it some more. I'm glad that you confirmed it for me.
I haven't tried it myself, but I suspect Google Analytic may be configured/hacked to do what you want. I don't know any free web analytic tools that would track bandwidth usage by directory (recursive?)... There are plenty of free apache log analyzers out there, you might be able to embed in your PHP code some kind of bandwidth usage stat and stick it in the apache log, or plot it to MRTG.
You _could_ run Wireshark to look at your traffic, you'd see all the HTTP headers and theoretically you can parse our the directory/file that's being hit/accessed... but Wireshark is meant to be a network sniffer, and this would be too inefficient (and resource intensive) to be practical.
You can also use a little script magic on your log file to pull out the date and bytes transferred for the directory in question, then total by day. But a web analytics tool will give you that and more.
Truman Leung
Sep 12, 2008
Josh Kuo
You _could_ run Wireshark to look at your traffic, you'd see all the HTTP headers and theoretically you can parse our the directory/file that's being hit/accessed... but Wireshark is meant to be a network sniffer, and this would be too inefficient (and resource intensive) to be practical.
Sep 13, 2008
Kurt Sussman
Sep 18, 2008