Questions? Feedback? powered by Olark live chat software
Knowledgebase
Author Avatar

Tracking Bandwidth - NetHogs

Written by: on 07 April 2014 08:50 AM 07 April 2014 08:50 AM

NetHogs is a utility which allows you to see what bandwidth each process on your system is using at a given time.

* Please note this article contains extracts from: http://www.cyberciti.biz/faq/linux-find-out-what-process-is-using-bandwidth/

Instead of breaking the traffic down per protocol or per subnet, like most such tools do, it groups bandwidth by process and does not rely on a special kernel module to be loaded. So if there's suddenly a lot of network traffic, you can fire up NetHogs and immediately see which PID is causing this, and if it's some kind of spinning process, kill it.

Install nethogs under Debian or Ubuntu Linux

Type the following apt-get command to install nethogs package:
$ sudo apt-get install nethogs

Install nethogs under RHEL or CentOS or Fedora Linux

First turn on EPEL repository and type the following yum command to install nethogs:

yum install epel-release

yum install nethogs

How do I use nethogs?

The syntax is:

 
nethogs
nethogs eth1
nethogs [option] eth0 eth1
nethogs [option] eth0 eth1 ppp0
sudo /usr/sbin/nethogs eth0
 

Sample outputs:

Fig.01: nethogs in action

Fig.01: nethogs in action


Another output from one of my personal RHEL server:

Fig.02: Nethogs in action on my centos/rhel box

Fig.02: Nethogs in action on my centos/rhel box

 

Keyboard shortcuts

Use the following interactive controls:

  1. m : Cycle between display modes (kb/s, kb, b, mb)
  2. r : Sort by received.
  3. s : Sort by sent.
  4. q : Quit and return to the shell prompt.

 

 

 

(2 vote(s))
Helpful
Not helpful