I've looking after some Debian boxes and occasionally I see a big spike in the network traffic. I'm graphing metrics with graphite (being fed by a sensu check which gathers per-interface metrics every minute) and occasionally see this sort of thing:
I have no idea what's causing this, as I never manage to catch it while it's in progress. It'd be nice to figure out what's causing this, so what's the best approach to try and figure out what this could be?
I guess what I'm really after is this: Is there a way to audit a network connection (and process id/name) if the amount of data it has sent/received trips over a certain amount or rate?
You can easily track per-process network statistics using
nethogs
. There is a precompiled package for Debian.It works similarly to
top
:Check its manpage for further options.
I would modify your sensu (nagios?) plugin to run a ps or top command and dump the output to a local file. Then go back and correlate your spikes to the ps/top output to figure out what is going on.
If you don't want to or can't do the change, look at sar or atop.
EDIT: Next idea, run tcpdump then review the traffic in wireshark.