Quick disclaimer. I don't code in PHP, and I am just helping the people responsible for this service.
Recently we started to have problems with one server who uses php-prefork and without trying to understand the problem we rushed to increase the prefork workers value (as if big numbers fix everything), which only made it worse.
I have very limited knowledge on PHP and its server limitations, so I just enabled the module for server status and waited until the service became responsible. This is what I found:
Current Time: Thursday, 22-Dec-2022 14:54:23 -03
Restart Time: Wednesday, 21-Dec-2022 14:04:02 -03
Parent Server Config. Generation: 2
Parent Server MPM Generation: 1
Server uptime: 1 day 50 minutes 20 seconds
Server load: 3.81 3.47 2.84
Total accesses: 671477 - Total Traffic: 5.8 GB - Total Duration: 1429245778
CPU Usage: u25.56 s38.92 cu10948.3 cs14397.8 - 28.4% CPU load
7.51 requests/sec - 67.9 kB/second - 9.0 kB/request - 2128.51 ms/request
256 requests currently being processed, 0 idle workers
RCRRWRRRRKRRCRWRKRRRRWKWRRRRRRRKWCRKRRRCKRRWRKWRRRCRRRWRRRRRRRCR
RWCRRKRRWRWRKRWRKRKWRKRKRRRRRWKRKRRRRRRWCWKRKRWKRRRRKKRRRKWRRRRR
RRRRKWRWKRKRRRRRWRRKRKRRRRWCKWRKRRRRRRKRRWRCCRWRRWWRRRRRWRRRRRRR
KRRRRRRRRKRKRRRRKKRRRRKKWRRKRRWKRRKRRCWRWKRRKKRKCRRCRRKRRRRRKRKC
Limiting the keep_alive
would fix this? I am afraid of twerking its value because this service is also used to generate some of the slowest reports I ever saw...
Also, more than half of the connections came from a terrible mobile app running on a single cell phone...
UPDATE:
I reduce the keepalive numbers but it showed no real difference.