2

I've got a VPS running Ubuntu and Apache and hosting several sites on it using virtual hosts. It would be very interesting to monitor which of these sites takes the most power and bandwidth, I've been looking for a tool for that but haven't found any. Do you guys know a tool or a way to do this?

2

You do not need a tool for this, apache is capable of tracking this itself.
To accomplish this you need to set up logging to log out the size of each response by the web server. You can either place both virtualhosts into the same log file (and just add the virtualhost name to each log entry), or put them in separate log files.

To create log entries in the logs/transfer file with 3 fields, the virtual host, the bytes received, and the bytes sent (requires mod_logio)

CustomLog logs/transfer "%v %I %O"

If you do not have mod_logio, you can log the bytes sent back (not including headers) with

CustomLog logs/transfer "%v %B"

You can consult the documentation on the available log parameters.

  • That sounds good but I still need to create my own tool for visualizing the data in that case. What I was looking for was more of a complete solution for it – Alm Sep 10 '12 at 9:02
0

wireshark can do this on the network level. It should be enough to look at the IP-headers for your purpose.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.