The site has occasionally stopped responding even though the server itself was still running.
The main issue appears to have been that PHP-FPM was configured to run only five PHP processes at the same time. This does not mean that only five visitors could use the site. Each process handles a PHP request, finishes it, and then immediately becomes available for the next request.
Most visitors only occupy a PHP process for a fraction of a second while the page is being generated. Static files such as images, CSS and JavaScript are normally served separately by Apache.
Problems occur when several PHP requests become slow or get stuck. If all available PHP processes are occupied, new page requests must wait in a queue, making the site appear to have frozen.
The following changes have now been made:
Content
The site has occasionally stopped responding even though the server itself was still running.
The main issue appears to have been that PHP-FPM was configured to run only five PHP processes at the same time. This does not mean that only five visitors could use the site. Each process handles a PHP request, finishes it, and then immediately becomes available for the next request.
Most visitors only occupy a PHP process for a fraction of a second while the page is being generated. Static files such as images, CSS and JavaScript are normally served separately by Apache.
Problems occur when several PHP requests become slow or get stuck. If all available PHP processes are occupied, new page requests must wait in a queue, making the site appear to have frozen.
The following changes have now been made:
The maximum number of simultaneous PHP processes has been increased from five to eight.
More PHP processes are kept ready to handle temporary traffic increases.
PHP processes are recycled after 200 requests to reduce the risk of memory usage building up over time.
Requests taking longer than five seconds are now recorded in a slow log.
PHP requests that remain stuck for more than two minutes are automatically terminated.
The same configuration has been applied to PHP 8.3, 8.4 and 8.5.
A maintenance script has been created that checks these settings and only updates the configuration when something is missing or incorrect.
These changes should reduce the risk of the site becoming unresponsive during temporary load increases or when individual requests take too long.
If the problem happens again, the new logs should also make it easier to identify the exact page, plugin or function causing the delay. And eventually render that we move elsewhere, one more time.