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 01 Container consistency 02 Con...
<br />Most of the time when we talk about na...
The relevant person in charge of Baidu Input Metho...
need: Use vue to realize QR code scanning; Plugin...
1. Grammar: <meta name="name" content...
1. Docker network management 1. Docker container ...
Flex layout is a commonly used layout method nowa...
Table of contents Problem Description Scenario In...
MySQL database crashes after entering password an...
There are some tags in XHTML that have similar fu...
This article example shares the specific code of ...
Table of contents Solution 1: Rebuild Replicas Pr...
Table of contents Object.prototype.valueOf() Obje...
MySQL 8.0.18 stable version (GA) was officially r...
1. Scroll Snap is a must-have skill for front-end...