How can I monitor network usage by process on Mac OS X?

30

10

Possible Duplicate:
Application for monitoring all applications that are using the internet in Mac OS X
Bandwidth monitor for Mac OS X?

Is there any way to find out which process using how much internet bandwidth on Mac OS X Lion? I'm on mobile internet now, which is not very fast, so it would be nice if I can tell that for example, Chrome using 10kB/s, and Skype using 2kB/s.

I can see the total amount of traffic in Activity Monitor, but it is not enough for me.

I'd like to use an existing application, not interested to write an app like this. And I'm not interested in the actual traffic, only the number of bytes transferred and received by each processes.

psmith

Posted 2011-11-05T12:02:12.407

Reputation: 485

Question was closed 2012-11-13T09:34:14.593

Finally I've modified iftop's source to produce an output which can be parsed with awk, and can be merged with lsof. Now I can see the bandwidth usage by processes in a hacky way... – psmith – 2011-11-23T09:38:38.107

1Would you care to share? – Henno – 2013-04-10T09:01:47.147

Answers

42

Mac OS X Lion (10.7.x) contains a command called nettop that gets you most of the way there. Be sure to check the man page to learn the navigation keys and note the d key for toggling delta display. Not quite the kB/s display you were looking for, but close perhaps.

I'd be interested in hearing if this works better or worse for you than your iftop/awk/lsof hack.

Update: Also, be sure to make your terminal window...
R       E       A       L       L       Y       W       I       D       E.
nettop has lots of columns that it won't draw and won't even tell you about if your terminal window is too narrow.

Spiff

Posted 2011-11-05T12:02:12.407

Reputation: 84 656

3I think it should be even wider than you recommend. – Michael Krelin - hacker – 2018-02-05T14:30:27.250

9You can also use/press c-for collapsed view for more press h-help – Natwar Singh – 2014-04-02T18:35:51.740