Aug 16 2008
Monitoring and measuring bandwidth
True “unlimited” bandwidth is pretty much dead these days, and so it should be in my opinion. I would much rather have high speed and a fixed amount bandwidth than be forced to a limited amount of bandwidth by having a slow access speed.
Whether you have a shared hosting, a vps or a dedicated server you are most likely to have a fixed amount of bandwidth whether you know it or not.
I’ve decided to monitor and measure my bandwidth usage from the start. I think its generally good practice and I certainly don’t want to get stung by excess charges if I use more than my host allows. Also a sudden increase could be a sign of a security breach.
I installed a couple of applications, the first was a real time bandwidth monitoring tool.
# apt-get install bwm
sailes:/# bwm
Bandwidth Monitor 1.1.0 Iface RX(KB/sec) TX(KB/sec) Total(KB/sec) lo 0.000 0.000 0.000 eth0 5.497 21.489 26.9860 Total 5.497 21.489 26.9860 Hit CTRL-C to end this madness.
The second records and summaries my bandwidth usage by hour and day.
# apt-get install vnstat
Check your interfaces with ifconfig
# vnstat -u -i eth0
sailes:/# vnstat
Database updated: Sat Aug 16 22:20:01 2008
eth0
received: 895.92 MB (45.9%)
transmitted: 1053 MB (54.1%)
total: 1949 MB
rx | tx | total
-----------------------+------------+-----------
yesterday 12.75 MB | 83.79 MB | 96.54 MB
today 25 MB | 104.73 MB | 129.74 MB
-----------------------+------------+-----------
estimated 26 MB | 111 MB | 137 MB
