了解 top 命令高平均负载和高 CPU 空闲

了解 top 命令高平均负载和高 CPU 空闲

DirectAdmin 向我发送了以下top输出:

This is an automated message notifying you that the 5 minute load average on your system is 179.99.
This has exceeded the 10 threshold.

One Minute      - 171.19
Five Minutes    - 179.99
Fifteen Minutes - 170.21

top - 10:30:55 up 11 days, 23:48,  0 users,  load average: 138.58, 160.32, 164.04
Tasks: 605 total,   2 running, 603 sleeping,   0 stopped,   0 zombie
Cpu(s):  2.9%us,  0.8%sy,  0.0%ni, 88.5%id,  7.6%wa,  0.0%hi,  0.0%si,  0.0%st
Mem:   1920560k total,  1866292k used,    54268k free,     2040k buffers
Swap: 10485752k total,  4295252k used,  6190500k free,    35208k cached

 PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            
  23 root      20   0     0    0    0 S  0.7  0.0   4:33.08 [kblockd/1]                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        
  22 root      20   0     0    0    0 S  0.5  0.0   3:02.55 [kblockd/0]                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        
13874 apache    20   0  733m 8704 4032 D  0.2  0.5   0:03.90 /usr/sbin/httpd -k start -DSSL                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     
1431 mysql     20   0 1654m  40m 1932 S  0.2  2.2  96:29.55 /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --plugin-dir=/usr/lib64/mysql/plugin --user=mysql --log-error=/var/lib/mysql/server.com.err --pid-file=/var/lib/mysql/server.com.pid --socket=/var/lib/mysql/mysql.sock --port=3306                                                                                                                                                                                                                                                                   
1520 mail      20   0 59344  596  500 S  0.2  0.0   0:19.71 /usr/sbin/exim -bd -q15m -oP /var/run/exim.pid                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     
14163 apache    20   0  735m  10m 5300 D  0.1  0.5   0:03.51 /usr/sbin/httpd -k start -DSSL                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     
13922 apache    20   0  737m 9040 4960 S  0.1  0.5   0:04.09 /usr/sbin/httpd -k start -DSSL                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     
14181 apache    20   0  739m  17m 3284 D  0.1  1.0   0:04.36 /usr/sbin/httpd -k start -DSSL                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     
28173 root      20   0 15420 1584  852 R  0.1  0.1   0:00.09 /usr/bin/top -c -b -n 1                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            
14157 apache    20   0  739m 7696 3252 S  0.1  0.4   0:03.15 /usr/sbin/httpd -k start -DSSL                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     
14217 apache    20   0  740m  14m 3860 D  0.1  0.8   0:03.37 /usr/sbin/httpd -k start -DSSL                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     
14615 apache    20   0  734m 7984 3116 D  0.1  0.4   0:02.34 /usr/sbin/httpd -k start -DSSL                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     
14644 apache    20   0  734m 9660 4080 D  0.1  0.5   0:03.36 /usr/sbin/httpd -k start -DSSL                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     
15159 apache    20   0  727m  13m 4928 S  0.1  0.7   0:01.47 /usr/sbin/httpd -k start -DSSL                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     
15202 apache    20   0  727m 9396 4812 D  0.1  0.5   0:01.73 /usr/sbin/httpd -k start -DSSL                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     
15362 apache    20   0  734m 7484 5032 D  0.1  0.4   0:03.17 /usr/sbin/httpd -k start -DSSL                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     
15498 apache    20   0  723m 8924 4996 D  0.1  0.5   0:02.36 /usr/sbin/httpd -k start -DSSL                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     
15577 apache    20   0  723m 9892 5276 D  0.1  0.5   0:02.42 /usr/sbin/httpd -k start -DSSL                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     
19951 apache    20   0  723m  10m 5344 D  0.1  0.6   0:01.47 /usr/sbin/httpd -k start -DSSL                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     
28167 root      20   0 15420 1584  852 R  0.1  0.1   0:00.10 /usr/bin/top -c -b -n 1                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            
   4 root      20   0     0    0    0 S  0.1  0.0   2:52.17 [ksoftirqd/0]                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      
  11 root      20   0     0    0    0 S  0.1  0.0  11:36.80 [events/0]                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         
  39 root      20   0     0    0    0 D  0.1  0.0   1:34.68 [kswapd0] 

我无法理解为什么平均负载如此高,平均负载通常是load average: 0.48, 0.23, 0.14。那么,这里究竟发生了什么?我没有看到任何进程使用任何内存,也没有任何进程使用高 CPU %,那么到底发生了什么?

答案1

负载值非常高的原因是您有许多 Apache 进程(可能永久)被 I/O 阻塞。它们不消耗 CPU,但会增加负载。

相关内容