How to use a simple Linux utility to see what is hogging your network bandwidth.
The nethogs utility allows you to see what is hogging your bandwidth. Type sudo apt-get install nethogs
to install this.
Then run it like this:
4.4 Mon Dec 17 jason@Yog-Sothoth 0: $ sudo nethogs 1) All commands run with root privileges are always dangerous. 2) Never run commands on an environment you are not willing to destroy, or able to restore. 3) Do not become root until you know what you are going to do. 4) Be sure of your command and what is going to be affected by it. [sudo] password for jason: Ethernet link detected Waiting for first packet to arrive (see sourceforge.net bug 1019381) |
A screen like the one shown below will appear. This will show the programs that are hogging your bandwidth.
This is a very useful command if you want to find a rogue process on your system that has run away and is hammering your bandwidth.
The -t parameter enables tracemode, this outputs the information into the terminal. Here is an example.
4.4 Mon Dec 17 jason@Yog-Sothoth 0: $ sudo nethogs -t Adding local address: 192.168.1.2 Ethernet link detected Waiting for first packet to arrive (see sourceforge.net bug 1019381) Refreshing: unknown TCP/0/0 0 0 Refreshing: transmission-gtk/5272/1000 4.07676 25.3014 unknown TCP/0/0 0 0 Refreshing: transmission-gtk/5272/1000 10.0824 57.2488 /usr/bin/tor/1581/131 0.118945 0.0128906 unknown TCP/0/0 0 0 Refreshing: transmission-gtk/5272/1000 24.1646 103.396 192.168.1.2:51047-68.133.2.96:50321/0/0 0.025 0.0144531 192.168.1.2:53279-218.101.89.60:6881/0/0 0.025 0.0128906 /usr/bin/tor/1581/131 0.118945 0.0128906 192.168.1.2:34387-95.239.136.134:50545/0/0 0.0144531 0 192.168.1.2:57059-37.127.126.28:60830/0/0 0.0144531 0 unknown TCP/0/0 0 0 |
All of the available command-line parameters.
4.4 Mon Dec 17 jason@Yog-Sothoth 0: $ sudo nethogs -h usage: nethogs [-V] [-h] [-b] [-d seconds] [-v mode] [-c count] [-t] [-p] [-s] [device [device [device ...]]] -V : prints version. -h : prints this help. -b : bughunt mode - implies tracemode. -d : delay for update refresh rate in seconds. default is 1. -v : view mode (0 = KB/s, 1 = total KB, 2 = total B, 3 = total MB). default is 0. -c : number of updates. default is 0 (unlimited). -t : tracemode. -p : sniff in promiscious mode (not recommended). -s : sort output by sent column. -a : monitor all devices, even loopback/stopped ones. device : device(s) to monitor. default is all interfaces up and running excluding loopback When nethogs is running, press: q: quit s: sort by SENT traffic r: sort by RECEIVE traffic m: switch between total (KB, B, MB) and KB/s mode |
Another very good utility to monitor bandwidth usage is nload. This will display a graph in the terminal showing network usage as separate graphs for receive and send.
This is a very good utility for watching network usage in real time.
Yet another network monitoring utility is bmon, just install this utility.
4.4 Mon Dec 17 jason@Yog-Sothoth 0: $ sudo apt install bmon |
Then run it to get very detailed info about your network usage.
These utilities will be very suitable for monitoring your network usage, this allows a user to see what services on their PC are using the network, and how much network traffic there is.