PHP-FPM performance for large environments.
PHP-FPM performance for large environments.
NDO being the known bottleneck for overall performance is there anything to be gained (safely) in a large environment by raising the PHP-FPM value for pm.max_requests greater than 250?
- jmichaelson
- Posts: 383
- Joined: Wed Aug 23, 2023 1:02 pm
Re: PHP-FPM performance for large environments.
The max_requests configuration option limits the number of requests a single php-fpm child process handles before it is killed by the parent and a new process spawned. The documentation here: https://www.php.net/manual/en/install.f ... ration.php gives reasons for not leaving it at its default of 0 (meaning it will go on forever). We deliberately set it to 250 in Nagios XI, to pre-emptively prevent issues where libraries we're using may have memory leaks. The risks of setting it higher (naturally the higher the limit the greater the risk) is that the Out of memory manager on your system may kill a different process if the committed memory gets too high from php-fpm. My guidance if you were to try it would be to monitor the memory usage of the php-fpm process over time versus the amount of available RAM. This may not end up being a problem, since with a non-zero number the php-fpm process will periodically be respawned. In short there's no technical reason you can't set it higher.
Please let us know if you have any other questions or concerns.
-Jason
-Jason