Linux/centos nethogs Monitor network bandwidth by process

Source: Internet
Author: User

There are many open-source network monitoring tools for Linux systems. For example, you can use command iftop to check bandwidth usage. Netstat is used to view the interface statistics report and the current running process of top monitoring system. But if you want to find a tool that can count network bandwidth utilization in real time, then Nethogs is worth a look.

Nethogs is an open source command-line tool (similar to the Linux top command) that is used to count network bandwidth usage in real time by process or program.

From the Nethogs Project website: "Nethogs is a small net top tool that, unlike most tools, slows down each protocol or the speed of each subnet and then groups the bandwidth by process. The nethogs does not need to rely on loading a particular kernel module. If a network block occurs, you can start nethogs immediately to see which PID is causing the condition. This makes it easy to figure out which program is running and suddenly takes up your bandwidth. ”

This article shows you how to install and use Nethogs to monitor network bandwidth usage by process under the Linux/centos operating system.

You can use the Yum installation command as follows:

Nethogs belongs to the Epel package, if the machine is not installed Epel need to install Epel first, the command is as follows

#rpm-UVH http://mirrors.ustc.edu.cn/fedora/epel/6/x86_64/epel-release-6-8.noarch.rpm

#yum-y Install libpcap nethogs

The installation is complete as shown

Command usage: Directly at the command line terminal input nethogs default listener eth0 network card information and is refreshed once per second as

#nethogs eth0-d 5//This command means monitoring the bandwidth usage of the NIC Eth0, refreshed every five seconds
If you want to monitor both the eth0 and ETH1 interfaces, use the following command:

#nethogs eth0 eth1

If it is connected to the eth0 can be replaced by the * * * * * * * card device can be

We use XFTP to transmit a mirror to see how the bandwidth is occupied such as:


It can be clearly seen that the sshd process takes up bandwidth, and if an unknown process on the server consumes bandwidth, this tool can be detected to help solve the problem

Nethogs other parameters and usage

-D: Refresh Interval
-H: Help
-p:promiscious mode
-t:trace mode
-V: Version
Interactive commands
Here are some interactive commands for nethogs (keyboard shortcuts)

M: Modify Unit
R: Sort by traffic
S: Sort by send traffic
Q: Exit the command prompt

If you are interested in this, please scan the QR code below for free for more details

Linux/centos nethogs Monitor network bandwidth by process

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.