Ano*_*ous 33 networking linux io
诸如 iftop/iptraf 之类的已知工具显示每个接口和每个连接的网络 I/O。有没有办法查看每个进程的网络 I/O 统计信息?
要查找与每个进程关联的连接,请使用 lsof。例如:
lsof | grep TCP
Run Code Online (Sandbox Code Playgroud)
这将为您提供一个连接列表,如下所示:
bash 10887 luke 3u IPv4 44638801 0t0 TCP littleyerry.example.com:55212->barista.example.com:ldap (ESTABLISHED)
bash 10913 luke 3u IPv4 44638905 0t0 TCP littleyerry.example.com:55216->barista.example.com:ldap (ESTABLISHED)
ssh 10935 luke 3u IPv4 44639001 0t0 TCP littleyerry.example.com:55219->barista.example.com:ldap (ESTABLISHED)
ssh 10935 luke 4u IPv4 44639008 0t0 TCP littleyerry.example.com:59459->launchpad.example.com:ssh (ESTABLISHED)
bash 10938 luke 3u IPv4 44639107 0t0 TCP littleyerry.example.com:55221->barista.example.com:ldap (ESTABLISHED)
Run Code Online (Sandbox Code Playgroud)
从那里,您应该能够使用您提到的工具(iftop、iptraf)单独找出每个连接。您可以构建一个小脚本来聚合您要查找的特定数据。
| 归档时间: |
|
| 查看次数: |
39756 次 |
| 最近记录: |