我的环境:
- 在 Oracle Cloud 上托管的具有 4 个 OCPU 和 16GB RAM 的服务器;
- PHP-FPM 7.4.33 服务器;
- Apache/2.4.52(Ubuntu)mod_fcgid/2.3.9 OpenSSL/3.0.2;
- Ubuntu 22.04.3;
在此主机上,我有 10 个由 Webmin 管理的虚拟服务器。这是实际配置mpm_worker.conf:
<IfModule mpm_worker_module>
StartServers 2
MinSpareThreads 25
MaxSpareThreads 75
ThreadLimit 64
ThreadsPerChild 25
MaxRequestWorkers 400
MaxConnectionsPerChild 0
</IfModule>
主要问题是,到了晚上,Apache Web 服务器停止工作。这是Apache 错误日志:
[Mon Jan 08 12:55:34.197114 2024] [mpm_worker:notice] [pid 59625:tid 140484359948160] AH00297: SIGUSR1 received. Doing graceful restart
[Mon Jan 08 12:55:37.268217 2024] [mpm_worker:notice] [pid 59625:tid 140484359948160] AH00292: Apache/2.4.52 (Ubuntu) mod_fcgid/2.3.9 OpenSSL/3.0.2 configured -- resuming normal operations
[Mon Jan 08 12:55:37.268229 2024] [core:notice] [pid 59625:tid 140484359948160] AH00094: Command line: '/usr/sbin/apache2'
[Mon Jan 08 18:13:45.893453 2024] [mpm_worker:error] [pid 59625:tid 140484359948160] AH00288: scoreboard is full, not at MaxRequestWorkers
------------------------(a lot of scoreboard is full error)---------------------------------------------------------------------------------
[Mon Jan 08 20:09:42.080398 2024] [mpm_worker:error] [pid 59625:tid 140484359948160] AH00288: scoreboard is full, not at MaxRequestWorkers
[Tue Jan 09 00:00:01.001131 2024] [mpm_worker:notice] [pid 59625:tid 140484359948160] AH00297: SIGUSR1 received. Doing graceful restart
[Tue Jan 09 00:00:04.065096 2024] [mpm_worker:notice] [pid 59625:tid 140484359948160] AH00292: Apache/2.4.52 (Ubuntu) mod_fcgid/2.3.9 OpenSSL/3.0.2 configured -- resuming normal operations
[Tue Jan 09 00:00:04.065113 2024] [core:notice] [pid 59625:tid 140484359948160] AH00094: Command line: '/usr/sbin/apache2'
[Tue Jan 09 00:01:34.164734 2024] [mpm_worker:error] [pid 59625:tid 140484359948160] AH00288: scoreboard is full, not at MaxRequestWorkers
------------------------(a lot of scoreboard is full error)---------------------------------------------------------------------------------
[Tue Jan 09 00:20:21.322679 2024] [mpm_worker:error] [pid 59625:tid 140484359948160] AH00288: scoreboard is full, not at MaxRequestWorkers
这是我在apache 服务器状态页:
Current Time: Monday, 08-Jan-2024 12:25:40 CET
Restart Time: Monday, 08-Jan-2024 11:55:46 CET
Parent Server Config. Generation: 1
Parent Server MPM Generation: 0
Server uptime: 29 minutes 54 seconds
Server load: 0.45 0.38 0.36
Total accesses: 15338 - Total Traffic: 1.4 GB - Total Duration: 13637
CPU Usage: u8.25 s4.78 cu8.23 cs3.82 - 1.4% CPU load
8.55 requests/sec - 0.8 MB/second - 95.7 kB/request - .889099 ms/request
9 requests currently being processed, 66 idle workers
.................................................._L_L_R________
_____________R_____RL_L__________________________L______R____...
................................................................
................................................................
................................................................
................................................................
................
cache type: SHMCB, shared memory: 512000 bytes, current entries: 445
subcaches: 32, indexes per subcache: 88
time left on oldest entries' objects: avg: 13 seconds, (range: 1...69)
index usage: 15%, cache usage: 20%
total entries stored since starting: 5507
total entries replaced since starting: 0
total entries expired since starting: 3301
total (pre-expiry) entries scrolled out of the cache: 567
total retrieves since starting: 0 hit, 6 miss
total removes since starting: 1225 hit, 9 miss
这个问题几乎每天晚上都会发生,早上我不得不重新启动 Apache Web 服务器。这可能是什么原因造成的?
编辑: 大约 40 分钟后,该问题再次出现。以下是 Apache 服务器状态页面显示的内容:
Current Time: Tuesday, 09-Jan-2024 08:52:14 CET
Restart Time: Tuesday, 09-Jan-2024 08:03:40 CET
Parent Server Config. Generation: 1
Parent Server MPM Generation: 0
Server uptime: 48 minutes 33 seconds
Server load: 0.01 0.02 0.04
Total accesses: 543 - Total Traffic: 6.9 MB - Total Duration: 23449
CPU Usage: u3.22 s.75 cu0 cs0 - .136% CPU load
.186 requests/sec - 2487 B/second - 13.0 kB/request - 43.1842 ms/request
162 requests currently being processed, 38 idle workers
RCCCRCRCRRCRCCCRRRRRRRRR_RRCCCRCRCRCRCC_C_R_RR_RC_CRCRRRCCCRRRRR
WCRCRRRRRRRWCCCRRRRCC_RCCRCWRCRRW_RRRCRRCRRRRRCCRR_RCRCCRRCRRCCC
CCC_RC_R_WWW__R__RRRWRR_C_CWCCCCRRC_C_CRRW_RR_RC__CCCCCCC_R_____
________........................................................
................................................................
................................................................
................