Posted: . At: 5:22 PM. This was 5 years ago. Post ID: 6746
Page permalink. WordPress uses cookies, or tiny pieces of information stored on your computer, to verify who you are. There are cookies for logged in users and for commenters.
These cookies expire two weeks after they are set.

How to view programs on your network that are hogging your network bandwidth.

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.

The nethogs utility viewing bandwidth usage on a Linux PC.
The nethogs utility viewing bandwidth usage on a Linux PC.

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.

The nload utility showing incoming and outgoing network usage.
The nload utility showing incoming and outgoing network usage.

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.

The bmon utility showing very detailed network information.
The bmon utility showing very detailed network information.

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.

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.