Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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?

share|improve this question
add comment

2 Answers 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.

share|improve this answer
    
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
add comment

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

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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