How to measure the transfer speed of an individual process?

Posted on

Problem :

One of the processes on our webserver that talks to an external email server is running really slowly. How can I find its transfer speed to/from the mail server?

Needless to say I can’t just look at the transfer speed of the whole network interface, because there are many other active processes using the connection.

I tried poking around in /proc/23120/net/netstat but I don’t really know what I’m looking at.

Solution :

You need ‘nethogs’. I love this program. You can run it on specific interfaces also.

NetHogs version 0.8.0

PID   USER     PROGRAM                                 DEV        SENT      RECEIVED
3422  blarg    wget                                    eth0      11.576     617.750 KB/sec
3005  blarg    sshd: blarg@pts/0                       eth0       0.618       0.228 KB/sec
2443  blarg    sshd: blarg@pts/1                       eth0       0.533       0.099 KB/sec
?     root     unknown TCP                                        0.000       0.000 KB/sec

TOTAL                                                          12.727     618.077 KB/sec

Leave a Reply

Your email address will not be published. Required fields are marked *