我使用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