Overview There are many open source network monitoring tools for Linux. For example, you can use iftop to check bandwidth usage. netstat is used to view interface statistics, and top is used to monitor the current running processes on the system. But if you want to find a tool that can count the network bandwidth utilization by process in real time, then NetHogs is worth a look. NetHogs is a small net top tool that doesn't slow down each protocol or subnet like most tools do but groups bandwidth by process. NetHogs does not rely on loading a special kernel module. If there is a network congestion you can fire up NetHogs and immediately see which PID is causing it. This makes it easy to figure out which program is running wild and suddenly hogging your bandwidth. Simply put, you can use nethogs to view the traffic of processes under Linux. Installation and Deployment 1. Compile and install the nethogs dependency package. The default rpm warehouse of centos does not have the nethogs package, so we need to compile it manually. Nethogs compilation depends on 2 libraries, which need to be installed before compilation 2. Download nethogs Because there is a bug in 0.8 (creating socket failed while establishing local IP - are you root?), version 0.81 is used here. # wget -c https://github.com/raboof/nethogs/archive/v0.8.1.tar.gz 3. Compile and install # tar -xvf v0.8.1.tar.gz # cd nethogs-0.8.1/ # make && make install #The default installation path is /usr/local/sbin/nethogs 4. Test run: usage 1. Command line parameters 2. Example: Example 1: Set the refresh rate to 5 seconds, and use -d to specify the refresh rate # nethogs -d 5 Example 2: Monitor eth0 network bandwidth # nethogs eth0 Example 3: Monitor eth0 and eth1 interfaces simultaneously # nethogs eth0 eth1 3. Interactive commands: The following are some interactive commands (keyboard shortcuts) for NetHogs: m : Modify unit r : Sort by traffic s : Sort by sending traffic q : exit command prompt For a complete list of NetHogs command line tool parameters, refer to the NetHogs manual. To use it, enter Summarize The above is the Linux tool Nethogs introduced by the editor to monitor network bandwidth by process. I hope it will be helpful to everyone. If you have any questions, please leave me a message and the editor will reply to you in time. I would also like to thank everyone for their support of the 123WORDPRESS.COM website! You may also be interested in:
|
<<: In-depth understanding of the use of Vue
>>: Sharing the detailed process of setting up Mysql5.6 to allow external network access
Table of contents 1. Easy to use 2. Using generic...
// It took me a whole afternoon to install this, ...
Table of contents 1. Component Introduction 2. So...
1 Pull the image from hup docker pull nginx 2 Cre...
1. Prepare a new disk and format it with the same...
After minimizing the installation of Python8, I i...
This section provides an overview of some other i...
1. Download the installation package from the off...
This article shares the specific code of js to re...
Table of contents Preface 1. Less 2. Import your ...
I have been using CSS for a long time, but I have...
The inline-block property value becomes very usef...
Table of contents 1. substring() 2. substr() 3.in...
Because springboot has a built-in tomcat server, ...
Today I used a virtual machine to do an experimen...