how to measure MB/sec on specific socket

We have a web tier where once in a while a web node will slam our data nodes(plural) and if we could see the MB/second coming into that machine on all sockets or on individual sockets, we could immediately know which web node started to have a huge influx of doing stuff. This would be great for our monitoring capability.

Is there way to see a machines "current" MB/s intake?

I do not want to use a tool that tests bandwidth between nodes but rather just want to measure current status.


iptables has byte counter for each rule/chain (don't know the terminology exactly). So you can setup a noop policy for the ports you are interested in and then monitor the byte counters.

AFAIK this is the best way to go with some serious (automated) monitoring (as opposed to iftop and etc)


You can try to use the iftop command. It provides a nice curses display. This can show realtime and average statistics for an interface or specific source/destination/port. It can can also filter, but I haven't explored that functionality.

enter image description here

Host display:                          General:
 n - toggle DNS host resolution         P - pause display
 s - toggle show source host            h - toggle this help display
 d - toggle show destination host       b - toggle bar graph display
 t - cycle line display mode            B - cycle bar graph average

I ususally use iptraf for things like this:

iptraf

This screen shows a bunch of database connections, but you can filter for whatever you're interested in.