Using top it's easy to identify processes that are hogging memory and cpu, but ocasionally I see my computer's network activity spike, but I'm unable to determine which process is generating the activity. Where is the right place to look for this information?
使用top可以很容易地识别占用内存和CPU的进程,但偶尔我看到计算机的网络活动高峰,但我无法确定哪个进程正在生成活动。在哪里寻找这些信息的正确位置?
6 个解决方案
#1
You can also take a look at "NetHogs": http://nethogs.sourceforge.net/. Little yet very handy utility. Especially if you want to find out which process is taking the bandwidth.
您还可以查看“NetHogs”:http://nethogs.sourceforge.net/。实用性很小但非常方便。特别是如果你想知道哪个进程占用了带宽。
#2
You can install several applications to monitor network traffic in real time. NTOP, tcpdump, trafshow, iptraf.
您可以安装多个应用程序来实时监控网络流量。 NTOP,tcpdump,trafshow,iptraf。
I would go with NTOP or IPTRAF. But that's just a personal taste.
我会选择NTOP或IPTRAF。但这只是个人品味。
Also, with Linux's netstat you can use the -p flag to see how many connections is a process using.
此外,使用Linux的netstat,您可以使用-p标志来查看进程使用的连接数。
#3
You can also use iftop. In Ubuntu you can install it by typing in terminal: sudo aptitude install iftop
. To use type: sudo iftop -i eth0
, where eth0 is your network interface.
您也可以使用iftop。在Ubuntu中,您可以通过键入终端来安装它:sudo aptitude install iftop。要使用类型:sudo iftop -i eth0,其中eth0是您的网络接口。
#4
The package 'nmon' provides a comparable tool to top. The design's a bit different since the kernel doesn't provide excellent statistics via /proc.
包'nmon'提供了一个类似的工具顶部。设计有点不同,因为内核不能通过/ proc提供出色的统计数据。
Description: performance monitoring tool for Linux
nmon is a systems administrator, tuner, benchmark tool.
It can display the CPU, memory, network, disks (mini graphs or numbers),
There's also iftop:
还有iftop:
Description: displays bandwidth usage information on an network 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
#5
lsof -i -n -P gives you for each connection the process and the endpoints...
lsof -i -n -P为您提供进程和端点的每个连接...
#6
Small correction to Pablo Santa Cruz-
对Pablo Santa Cruz的小修正 -
On linux: netstat -p gives the pid of the program running on the port. On BSD: netstat -p is used to specify the protocol.
在linux上:netstat -p给出了在端口上运行的程序的pid。在BSD上:netstat -p用于指定协议。
#1
You can also take a look at "NetHogs": http://nethogs.sourceforge.net/. Little yet very handy utility. Especially if you want to find out which process is taking the bandwidth.
您还可以查看“NetHogs”:http://nethogs.sourceforge.net/。实用性很小但非常方便。特别是如果你想知道哪个进程占用了带宽。
#2
You can install several applications to monitor network traffic in real time. NTOP, tcpdump, trafshow, iptraf.
您可以安装多个应用程序来实时监控网络流量。 NTOP,tcpdump,trafshow,iptraf。
I would go with NTOP or IPTRAF. But that's just a personal taste.
我会选择NTOP或IPTRAF。但这只是个人品味。
Also, with Linux's netstat you can use the -p flag to see how many connections is a process using.
此外,使用Linux的netstat,您可以使用-p标志来查看进程使用的连接数。
#3
You can also use iftop. In Ubuntu you can install it by typing in terminal: sudo aptitude install iftop
. To use type: sudo iftop -i eth0
, where eth0 is your network interface.
您也可以使用iftop。在Ubuntu中,您可以通过键入终端来安装它:sudo aptitude install iftop。要使用类型:sudo iftop -i eth0,其中eth0是您的网络接口。
#4
The package 'nmon' provides a comparable tool to top. The design's a bit different since the kernel doesn't provide excellent statistics via /proc.
包'nmon'提供了一个类似的工具顶部。设计有点不同,因为内核不能通过/ proc提供出色的统计数据。
Description: performance monitoring tool for Linux
nmon is a systems administrator, tuner, benchmark tool.
It can display the CPU, memory, network, disks (mini graphs or numbers),
There's also iftop:
还有iftop:
Description: displays bandwidth usage information on an network 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
#5
lsof -i -n -P gives you for each connection the process and the endpoints...
lsof -i -n -P为您提供进程和端点的每个连接...
#6
Small correction to Pablo Santa Cruz-
对Pablo Santa Cruz的小修正 -
On linux: netstat -p gives the pid of the program running on the port. On BSD: netstat -p is used to specify the protocol.
在linux上:netstat -p给出了在端口上运行的程序的pid。在BSD上:netstat -p用于指定协议。