Nethogs is an open source network traffic monitoring tool that shows the bandwidth usage of each process, which makes it more intuitive to use the network. Nethogs supports IPV4 and IPV6 protocols, supports local network cards, and PPP links.
Where the PID column shows the program's process number, the user column shows the program's owner, the program column shows the specific name of the programs, the Dev column prompts the currently monitored device (eth0), the Sent column displays the traffic that the program sends the request, and the received column shows the traffic that the program receives the request
The user can verify which device (eth1, eth0) corresponds to the public network card through Ifconfig. Take the eth1 corresponding public network card as an example, can be nethogs eth1 to monitor the traffic on the public network card, especially when the bandwidth close to the upper limit, you can clearly determine the bandwidth flow is mainly consumed in which program.
In the Nethogs monitoring interface, click S can be sorted by sent column, click R to sort by received column, click M to toggle the display of different statistical units (KB/S, KB, b, MB). Toggle the display of statistical units as follows two graphs:
Nethogs The default monitoring interval is 1 seconds, and the user can also set the monitoring interval by nethogs-d. For example, to set the monitoring interval to 5 seconds, you can enter
Nethogs-d 5
Linux servers use Nethogs to monitor network usage for each process