How can I see how much network traffic each thread is doing in Linux?

4

3

How can I see how much network traffic each thread is doing in Linux?

Any information would be useful. (bytes transferred, # of accepts, etc)

blackwing

Posted 2010-08-19T23:17:43.367

Reputation: 511

Answers

3

You could try ntop.

After installing it, based on what distribution you're using, you will have to start the ntop service. Most probably it will look something like this (check your distro's documentation for proper ntop service starting):

service ntop start

After you successfully started the ntop service, you will be able to access ntop's web interface through your web browser:

http://localhost:3000/

Keep in mind that 3000 is the default port for ntop. If you changed it, you will have to change it in your browser as well. If you installed ntop on a remote machine, instead of "localhost", you will have to enter the proper IP/hostname.

After that, ntop usage is pretty straightforward. Go through its web interface and find the information you need. The web interface itself looks like this:

enter image description here
Source

enter image description here Source

pootzko

Posted 2010-08-19T23:17:43.367

Reputation: 613

Whilst this may theoretically answer the question, it would be preferable to include the essential parts of the answer here, and provide the link for reference. Also you link is dead.

– James Mertz – 2012-07-28T23:42:59.857

What I was trying to do was prevent link only answers. Your edit only makes this worse. Please take a look at this meta question and answer on how to recommend software without it being link only.

– James Mertz – 2012-07-29T16:33:14.690

1

There are several applications that can show you a "top"-like list of network traffic for a particular process or thread.

These are the two I've found most useful:

  1. nethogs

    enter image description here

  2. iftop

    enter image description here

Patkos Csaba

Posted 2010-08-19T23:17:43.367

Reputation: 1 542

Please explain further how this is useful to the question at hand. You should beware, that linking only answers are typically deleted. – James Mertz – 2012-07-28T18:30:48.823

And how would you improve this after 2 years? Seriously. The guy asked for network monitor software, I answered, someone else answered the same way 'ntop' ... I still don't see what's wrong here. All 3 programs (2 linked by me, the 3rd from the accepted answer) can do what the question asks for. – Patkos Csaba – 2012-07-28T19:02:53.110

I recommend looking at this answer on meta. What we're trying to do is improve answer, from being link only to super awesome ones. If you have any more questions, feel free to contact me in the Ask a Mod or Root Access chat rooms.

– James Mertz – 2012-07-28T23:42:29.220

I hope this version is good enough. If not, feel free to delete it. – Patkos Csaba – 2012-07-29T10:41:05.097

@PatkosCsaba: Screenshots often go a long way :) – Der Hochstapler – 2012-07-29T16:29:23.697