httpd CPU 使用率高,服务器负载高,strace 卡住

httpd CPU 使用率高,服务器负载高,strace 卡住

我正在使用 apache2 和 MariaDB 服务器运行 Directadmin。但我不明白为什么我的服务器的 CPU 使用率如此之高。

htop 截图

当我尝试查看 strace 发生了什么时,由于某种原因,它卡在了read(7,

[root@s1 my.cnf.d]# strace -p 6780
strace: Process 6780 attached
read(7,

但是当我尝试查看哪些文件已打开时(使用 htop 按l),它们不断变化。问题几天前开始出现,每秒的平均请求数没有变化。我尝试了很多方法来检查问题,但找不到任何解决方案。

Apache 服务器信息:

Current Time: Sunday, 22-Dec-2019 21:15:57 EET
Restart Time: Sunday, 22-Dec-2019 20:43:12 EET
Parent Server Config. Generation: 1
Parent Server MPM Generation: 0
Server uptime: 32 minutes 44 seconds
Server load: 22.42 16.36 10.82
Total accesses: 25799 - Total Traffic: 148.9 MB - Total Duration: 22078672311849
CPU Usage: u1358.74 s2198 cu33.49 cs58.63 - 186% CPU load
13.1 requests/sec - 77.7 kB/second - 5.9 kB/request - 855796000 ms/request
36 requests currently being processed, 92 idle workers

KR_W_LRLC____WR_R_L__R___R_RLL___L__LL_RL_R___L__L______LRLW_R_L
________L__________R____________________R____L_____L____R_______

顶部:

top - 21:22:43 up 26 days,  5:52,  1 user,  load average: 17.54, 16.13, 12.58
Tasks: 391 total,   3 running, 388 sleeping,   0 stopped,   0 zombie
%Cpu(s): 49.9 us, 49.6 sy,  0.0 ni,  0.3 id,  0.0 wa,  0.0 hi,  0.2 si,  0.0 st
KiB Mem : 32605832 total,   218292 free,  2629852 used, 29757688 buff/cache
KiB Swap: 16383996 total, 11705240 free,  4678756 used. 29463816 avail Mem

  PID USER      PR  NI    VIRT    RES    SHR S  %CPU %MEM     TIME+ COMMAND
 6780 apache    20   0 3738384 275780   5580 S 250.0  0.8  63:01.83 httpd
 6184 mysql     20   0 9831040 514744   6560 S  61.9  1.6  31:56.88 mysqld
 6947 apache    20   0 3602964 189968   4740 S  43.7  0.6  12:10.16 httpd
   46 root      20   0       0      0      0 S   9.9  0.0 428:13.94 kswapd0
 6257 dh00001   20   0  882312 197940  20488 S   3.6  0.6   0:57.29 php-fpm71
18045 admin     20   0  414864  26080  16620 S   3.3  0.1   0:01.30 php-fpm56
 7697 admin     20   0  415160  27148  17944 S   3.0  0.1   0:08.30 php-fpm56
 7707 admin     20   0  417504  28980  19428 S   3.0  0.1   0:08.89 php-fpm56
 7715 admin     20   0  417912  41828  31608 S   3.0  0.1   0:06.76 php-fpm56
15535 admin     20   0  415520  40260  30392 S   3.0  0.1   0:04.53 php-fpm56
15545 admin     20   0  415116  39756  30124 S   3.0  0.1   0:03.96 php-fpm56
 7672 admin     20   0  414948  40748  31456 S   2.6  0.1   0:08.54 php-fpm56
...

先感谢您。

相关内容