Server Bandwidth Tracking

If you live a world with bandwidth charges ( we're talking about pipe saturation not how many bytes you have transferred this month ) or you just want to know how much traffic is going through your server, then this post applies to you.

Tools like whm/cpanel are great to see how many bytes you have transferred in a particular month, but doesn't really give you an idea of peak usage in a bytes/second model. Say whm reports that you transferred 20 gigabytes last month, that's good information but does this mean that you transferred that many bytes evenly over the entire month? ( quick answer, no it does not )

To get this kind of information you will need to have a program retrieving data concerning the current usage of a network interface over a period of time. This is commonly done by a polling method using SNMP to see how many bytes transferred on a particular interface. You then poll this data over time and you can see your traffic graph.

There are many software pieces that can do this for you, two of the most popular among the open source world are MRTG and Cacti ( solely as the graphing solution, usually combined with a polling bot to retrieve the data ). MRTG by default only comes equipped to read SNMP data, but as with most servers an SNMP daemon is usually not something that is setup. You can configure MRTG to use a separate script that will pull the bytes transfered from a local network card, it can then use this information to plot bytes/second. When this is all setup and running you will have pretty graphs that show usage over time, so you can tell when it was that all those bytes were transferred.

This is particularly useful to track your usage for billing purposes and to get a good idea of high traffic times at the server level. Here is an example of what an MRTG graph looks like:

Comments

Be the first to leave a comment on this post.

Leave a comment

To leave a comment, please log in / sign up