我使用Ubuntu 14.04服务器(8核,16 GB RAM)来托管PHP网站,MySQL和Redis。 PHP web和MySQL的流量非常低(MySQL:每秒查询平均值:0.825)。 Redis每秒处理8011个命令。Ubuntu 14.04 nc 100%CPU使用率
今天我注意到,NC停留在top
顶部:
8348 root 20 0 11224 764 624 R 100.0 0.0 2277:01 nc
8319 root 20 0 11224 760 624 R 100.0 0.0 2277:59 nc
8324 root 20 0 11224 764 624 R 100.0 0.0 2278:09 nc
8344 root 20 0 11224 760 624 R 100.0 0.0 2277:07 nc
Stracing NC给出:
[email protected]:/home/user# strace -p 8348
Process 8348 attached
poll([{fd=3, events=POLLIN}, {fd=-1}], 2, 1000) = 1 ([{fd=3, revents=POLLERR}])
poll([{fd=3, events=POLLIN}, {fd=-1}], 2, 1000) = 1 ([{fd=3, revents=POLLERR}])
poll([{fd=3, events=POLLIN}, {fd=-1}], 2, 1000) = 1 ([{fd=3, revents=POLLERR}])
intentionally cutted N lines from output
上man poll
快速查找给我的信息是poll waits for one of a set of file descriptors to become ready to perform I/O.
如何我是否会发现文件描述符发生了什么(是文件描述符问题?)并修复nc占用100%CPU的问题?
谢谢我的用例是完全一样的。这完全回答了如何使用100%CPU修复NC。 – Aivaras