Such known tools like iftop/iptraf display network I/O per interface and per connection. Is there a way to see network I/O statistics per process?
Such known tools like iftop/iptraf display network I/O per interface and per connection. Is there a way to see network I/O statistics per process?
nethogs looks like it will do what you want.
EDIT: I needed to install ncurses-devel, libpcap and libpcap-devel to build.
To find what connections are associated with each process, use lsof. For example:
That will give you a list of connections, like this:
From there, you should be able to find out about each connection individually using the tools you mentioned (iftop, iptraf). You could build a small script to aggregate the specific data that you're looking for.