i have a web server on Debian and Apache2, about once a day or once every 2 days Apache2 crashes, here are the Apache2 error logs:
[Wed May 22 13:04:01.082969 2024] [mpm_prefork:error] [pid 874799] AH00161: server reached MaxRequestWorkers setting, consider raising the MaxRequestWorkers setting
[Wed May 22 13:04:23.002222 2024] [fcgid:warn] [pid 884698] mod_fcgid: process 1156942 graceful kill fail, sending SIGKILL
[Wed May 22 13:04:23.002268 2024] [fcgid:warn] [pid 884698] mod_fcgid: process 1156563 graceful kill fail, sending SIGKILL
[Wed May 22 13:04:27.651741 2024] [fcgid:warn] [pid 884698] mod_fcgid: process 1156881 graceful kill fail, sending SIGKILL
[Wed May 22 13:04:27.651781 2024] [fcgid:warn] [pid 884698] mod_fcgid: process 1156525 graceful kill fail, sending SIGKILL
[Wed May 22 13:04:27.651789 2024] [fcgid:warn] [pid 884698] mod_fcgid: process 1156820 graceful kill fail, sending SIGKILL
[Wed May 22 13:04:27.651798 2024] [fcgid:warn] [pid 884698] mod_fcgid: process 1156883 graceful kill fail, sending SIGKILL
[Wed May 22 13:04:31.000291 2024] [fcgid:warn] [pid 884698] mod_fcgid: process 1151570 graceful kill fail, sending SIGKILL
[Wed May 22 13:04:31.000319 2024] [fcgid:warn] [pid 884698] mod_fcgid: process 1156574 graceful kill fail, sending SIGKILL
[Wed May 22 13:04:31.000326 2024] [fcgid:warn] [pid 884698] mod_fcgid: process 1156542 graceful kill fail, sending SIGKILL
[Wed May 22 13:04:31.000334 2024] [fcgid:warn] [pid 884698] mod_fcgid: process 1156825 graceful kill fail, sending SIGKILL
[Wed May 22 13:04:31.000342 2024] [fcgid:warn] [pid 884698] mod_fcgid: process 1156578 graceful kill fail, sending SIGKILL
next error:
[Wed May 22 13:05:06.178950 2024] [mpm_prefork:notice] [pid 874799] AH00170: caught SIGWINCH, shutting down gracefully
and:
[Wed May 22 13:05:14.782075 2024] [fcgid:error] [pid 884698] FastCGI process 1156923 still did not exit, terminating forcefully
[Wed May 22 13:05:14.782134 2024] [fcgid:error] [pid 884698] FastCGI process 1164783 still did not exit, terminating forcefully
[Wed May 22 13:05:14.782142 2024] [fcgid:error] [pid 884698] FastCGI process 1164793 still did not exit, terminating forcefully
[Wed May 22 13:05:14.782151 2024] [fcgid:error] [pid 884698] FastCGI process 1164968 still did not exit, terminating forcefully
[Wed May 22 13:05:14.782159 2024] [fcgid:error] [pid 884698] FastCGI process 1165001 still did not exit, terminating forcefully
[Wed May 22 13:05:14.782168 2024] [fcgid:error] [pid 884698] FastCGI process 1165012 still did not exit, terminating forcefully
[Wed May 22 13:05:14.782177 2024] [fcgid:error] [pid 884698] FastCGI process 1165027 still did not exit, terminating forcefully
then, until Apache 2 is rebooted, the site does not turn on.
I tried changing the mpm_prefork.conf config and putting the following configuration there:
#StartServers 10
#MinSpareServers 10
#MaxSpareServers 20
#ServerLimit 2000
#MaxRequestWorkers 1500
#MaxConnectionsPerChild 10000
current mpm_prefork.conf:
StartServers 5
MinSpareServers 5
MaxSpareServers 10
MaxRequestWorkers 150
MaxConnectionsPerChild 0
The virtual machine has 8 processor cores and 16 RAM cores. At the moment when errors were pouring in, I looked at the htop and there were tasks from 250 to 390 approximately, the average load can grow to 9-10, although usually it is 0.5-1.5, there is also a lot of free RAM, about 4-5 gigabytes are occupied at the moment of high load
This happens at random times, I don’t understand what to do, please help!