CPU 100%闲置但仍显示平均负载

我有一个CentOS 6.4的刀片服务器。

在空闲状态下,它performance出一个大于1的恒定负载平均值。然而,我准备了另一台具有相同硬件和CentOS版本的机器,当它闲置时,它的平均负载保持在0左右。

顶部的输出如下:

top - 10:23:04 up 156 days, 18:15, 1 user, load average: 1.08, 1.35, 1.31 Tasks: 534 total, 1 running, 533 sleeping, 0 stopped, 0 zombie Cpu(s): 0.0%us, 0.0%sy, 0.0%ni,100.0%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st Mem: 65959040k total, 10021484k used, 55937556k free, 167092k buffers Swap: 32767992k total, 13884k used, 32754108k free, 7084024k cached PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 20951 root 20 0 15396 1608 952 R 0.3 0.0 0:01.52 top 1 root 20 0 19352 684 472 S 0.0 0.0 0:01.64 init 2 root 20 0 0 0 0 S 0.0 0.0 0:00.03 kthreadd 3 root RT 0 0 0 0 S 0.0 0.0 0:15.31 migration/0 4 root 20 0 0 0 0 S 0.0 0.0 0:12.32 ksoftirqd/0 5 root RT 0 0 0 0 S 0.0 0.0 0:00.00 migration/0 6 root RT 0 0 0 0 S 0.0 0.0 0:17.45 watchdog/0 7 root RT 0 0 0 0 S 0.0 0.0 0:16.26 migration/1 8 root RT 0 0 0 0 S 0.0 0.0 0:00.00 migration/1 9 root 20 0 0 0 0 S 0.0 0.0 0:18.51 ksoftirqd/1 

哪个进程在完全空闲时导致系统平均负载> 1?

平均负载并不意味着你的想法。 这不是即时CPU使用率,而是有多less进程正在等待运行。 通常这是因为很多想要CPU的东西,但并不总是如此。 一个常见的罪魁祸首是一个等待IO磁盘或networking的进程。

尝试运行ps -ev并查找进程状态标志。

 state The state is given by a sequence of characters, for example, "RWNA". The first character indicates the run state of the process: D Marks a process in disk (or other short term, uninterruptible) wait. I Marks a process that is idle (sleeping for longer than about 20 seconds). L Marks a process that is waiting to acquire a lock. R Marks a runnable process. S Marks a process that is sleeping for less than about 20 seconds. T Marks a stopped process. W Marks an idle interrupt thread. Z Marks a dead process (a "zombie"). 

这是从ps manpage,所以你在那里find更多的细节 – RD过程可能是特别感兴趣的。

您的顶级输出包含:

 Tasks: 534 total, 1 running, 533 sleeping, 0 stopped, 0 zombie 

这1个运行过程是你的平均负载的原因。 find它,并找出它是什么。 (编辑:正如评论中提到的 – running过程可能是top ,所以忽略)