以下是顶部输出:
top - 19:20:47 up 1 day, 4:30, 1 user, load average: 0.01, 0.07, 0.12
Tasks: 170 total, 1 running, 169 sleeping, 0 stopped, 0 zombie
%Cpu(s): 0.6 us, 0.9 sy, 0.0 ni, 95.4 id, 0.1 wa, 0.0 hi, 0.0 si, 3.0 st
KiB Mem: 8167220 total, 7878764 used, 288456 free, 296816 buffers
KiB Swap: 1952764 total, 12672 used, 1940092 free, 1671708 cached
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
2799 app0005 20 0 1565m 866m 11m S 106.6 10.9 1718:03 java
为什么一个进程连续几个小时以 100% 的 CPU 运行,但系统负载仍然接近 0.0?
操作系统是 Debian Wheezy,虚拟机在 Citrix XenServer 上运行,使用 4 个核心。
以下是 pidstat -p 2799 -t 5 3 的输出(省略了许多值为 0.00 的行):
Linux 3.2.0-4-amd64 (s1018) 08/04/2015 _x86_64_ (4 CPU)
05:33:33 AM TGID TID %usr %system %guest %CPU CPU Command
05:33:38 AM 2799 - 75.65 35.53 0.00 111.18 2 java
05:33:38 AM - 2799 0.00 0.00 0.00 0.00 2 |__java
05:33:38 AM - 2836 23.95 33.93 0.00 57.88 1 |__java
05:33:38 AM - 3291 33.33 12.77 0.00 46.11 1 |__java
05:33:38 AM TGID TID %usr %system %guest %CPU CPU Command
05:33:43 AM 2799 - 29.60 77.80 0.00 107.40 2 java
05:33:43 AM - 2836 17.00 41.40 0.00 58.40 0 |__java
05:33:43 AM - 3291 10.60 36.80 0.00 47.40 1 |__java
05:33:43 AM TGID TID %usr %system %guest %CPU CPU Command
05:33:48 AM 2799 - 40.40 66.80 0.00 107.20 2 java
05:33:48 AM - 2836 21.60 37.00 0.00 58.60 1 |__java
05:33:48 AM - 3291 13.20 34.60 0.00 47.80 0 |__java
Average: TGID TID %usr %system %guest %CPU CPU Command
Average: 2799 - 48.57 60.03 0.00 108.59 - java
Average: - 2799 0.00 0.00 0.00 0.00 - |__java
Average: - 2836 20.85 37.44 0.00 58.29 - |__java
Average: - 3291 19.05 28.05 0.00 47.10 - |__java