25

Is there a program that I can use to list processes based on their current network I/O usage? top does CPU, and on FreeBSD at least, it will also do disk I/O if you pass it -m io (I assume that there's an equivalent of some kind on Linux, but I don't remember it off the top of my head). But what I'd like is specifically network I/O so that I can see which processes are using it and how much. Is there a program that I can use to list processes that way? And if not, what would be the best alternative?

3
  • 1
    iptraf might be the thing you are looking for.
    – Serge
    Commented Jun 4, 2016 at 23:36
  • ntop? nethogs? iptraf? iptstat? cacti?
    – DopeGhoti
    Commented Jun 5, 2016 at 2:28
  • 1
    Nowadays Debian/Ubuntu users want iptraf-ng because the old iptraf package is abandonware. Commented Sep 1, 2017 at 12:05

4 Answers 4

25

There's ntop and nethogs.

And on Linux there's iotop for io.

4
  • nethogs is pretty cool. Which package is ntop on ubuntu/debian from?
    – arthur
    Commented Nov 6, 2018 at 17:47
  • 1
    I don't remember what package I got ntop from. When I search the repositories now, I find ntopng, where the description says (among other things): "ntopng is the next generation version of the original ntop", but I haven't tried it. Commented Nov 6, 2018 at 20:16
  • Indeed! I've downloaded the package nicely.. and realized that it starts a web server and does quite a number of fancy things: ntop.org/products/traffic-analysis/ntop. Thanks for commenting on it, even years after the post
    – arthur
    Commented Nov 8, 2018 at 7:44
  • 2
    ntop and ntopng are huuge. im voting for nethogs and iftop
    – milahu
    Commented Jun 12, 2022 at 20:05
6

iftop is another alternative you might try.

2

nethogs as suggested in the accepted answer is probably the right tool to see network usage by process.

For other console network monitoring tools, here is a list of current tools on Debian 11 (or Ubuntu 20.04 LTS).

apt show bwm-ng cbm dstat iftop iptraf-ng nethogs nload

In alphabetical order, with an excerpt of the description:

  • bwm-ng (https://www.gropp.org/?id=projects&sub=bwm-ng)

    small and simple console-based bandwidth monitor

  • cbm (https://github.com/resurrecting-open-source-projects/cbm)

    The Color Bandwidth Meter (CBM) is a small program to display the traffic currently flowing through the network devices in a simple curses-based GUI.

  • dstat (http://dag.wiee.rs/home-made/dstat/)

    versatile resource statistics tool Dstat is a versatile replacement for vmstat, iostat and ifstat. Dstat overcomes some of the limitations of these programs and adds some extra features. Dstat allows you to view all of your network resources instantly, you can for example, compare disk usage in combination with interrupts from your IDE controller, or compare the network bandwidth numbers directly with the disk throughput (in the same interval).

    • dstat -n --nocolor -f
    • dstat -n --tcp --udp -f
    • etc.
  • iftop (http://www.ex-parrot.com/~pdw/iftop/)

    displays bandwidth usage information on an network interface iftop does for network usage what top(1) does for CPU usage.

    • iftop -i interface # (specify interface. Only 1 at a time)
  • iptraf-ng (https://github.com/iptraf-ng/iptraf-ng)

    IPTraf-ng is an ncurses-based IP LAN monitor that generates various network statistics including TCP info, UDP counts, ICMP and OSPF information, Ethernet load info, node stats, IP checksum errors, and others.

  • nethogs (https://github.com/raboof/nethogs)

    Net top tool grouping bandwidth per process

  • nload (http://www.roland-riegel.de/nload/)

    realtime console network usage monitor

    (Use and to move between interfaces to display)

0

A new kid in the neighbourhood — bandwhich, not in the ootb repos, but can be built with cargo (written in rust); also binaries binaries are available on the github project page.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .