Linux 上的网络使用 top/htop
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/368002/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Network usage top/htop on Linux
提问by xxxxxxx
Is there a htop/top on Linux where I get to sort processes by network usage?
Linux 上是否有 htop/top 可以按网络使用情况对进程进行排序?
采纳答案by Egil
回答by Jim T
Also iftop:
还有iftop:
display bandwidth usage on an interface
iftop does for network usage what top(1) does for CPU usage. It listens to network traffic on a named interface and displays a table of current bandwidth usage by pairs of hosts. Handy for answering the question "why is our ADSL link so slow?"...
在接口上显示带宽使用情况
iftop 对网络使用情况的作用就像 top(1) 对 CPU 使用情况的作用一样。它侦听命名接口上的网络流量,并按主机对显示当前带宽使用情况表。方便回答“为什么我们的 ADSL 链接这么慢?”的问题...
回答by Jim T
NetHogsis probably what you're looking for:
NetHogs可能就是你要找的:
a small 'net top' tool. Instead of breaking the traffic down per protocol or per subnet, like most tools do, it groups bandwidth by process.
NetHogs does not rely on a special kernel module to be loaded. If there's suddenly a lot of network traffic, you can fire up NetHogs and immediately see which PID is causing this. This makes it easy to identify programs that have gone wild and are suddenly taking up your bandwidth.
Since NetHogs heavily relies on /proc, most features are only available on Linux. NetHogs can be built on Mac OS X and FreeBSD, but it will only show connections, not processes...
一个小的“网顶”工具。它不像大多数工具那样按协议或每个子网分解流量,而是按进程对带宽进行分组。
NetHogs 不依赖于要加载的特殊内核模块。如果突然出现大量网络流量,您可以启动 NetHogs 并立即查看是哪个 PID 导致了这种情况。这使您可以轻松识别已变得疯狂并突然占用您带宽的程序。
由于 NetHogs 严重依赖 /proc,因此大多数功能仅在 Linux 上可用。NetHogs 可以在 Mac OS X 和 FreeBSD 上构建,但它只会显示连接,而不是进程......