- Server operating system version
- Ubuntu 20.04.5 LTS x64
- Plesk version and microupdate number
- Plesk Obsidian Web Admin Edition Versión 18.0.49 Actualización #2
PROBLEM DESCRIPTION
Under load conditions, PHP-FPM (7.3) processes increase to about 500 at which point it shows to the php-fpm error log "Too many open files" and the web stops serving content until the number of php-fpm processes fpm drops again.
On the server we have PLESK installed with 4 websites (1 website for production and 3 websites for development with the same code an BBDD in each of them).
Server has 96 Gb de RAM and nvme disks.
STEPS TO REPRODUCE
Parameters of configuration file /var/www/vhosts/system/XXXXXXXX/conf/php-fpm.conf is:
[php-fpm-pool-settings]
pm = dynamic
pm.max_children = 1000
pm.start_servers = 100
pm.min_spare_servers = 100
pm.max_spare_servers = 200
pm.max_requests = 2000
Before we have this parameter:
pm.max_children = 500
and got an error like this:
WARNING: [pool XXXXXXXXX] server reached max_children setting (*), consider raising it
and then we go up to 1000 and now we get an error like this:
ERROR: failed to prepare the stderr pipe: Too many open files (24)
Then we add this parameter to php-fpm configuration:
rlimit_files = 65536
and the log kept showing the above error message (Too many open files). Then we raise the value of the parameter again:
rlimit_files = 131072
and now we keep getting the same error in the php-fpm log:
ERROR: failed to prepare the stderr pipe: Too many open files (24)
It seems as if it is ignoring the limit we just imposed on the service php-fpm.
ACTUAL RESULT
Error messages in log /var/www/vhosts/XXXXXX/logs/php-fpm_error_log:
ERROR: failed to prepare the stderr pipe: Too many open files (24)
ERROR: failed to prepare the stderr pipe: Too many open files (24)
When browsing the web at that time, a white screen appears waiting to receive data from the web.
EXPECTED RESULT
That the php-fpm error disappears:
ERROR: failed to prepare the stderr pipe: Too many open files (24)
and that our website is served correctly in thos conditions.
Under load conditions, PHP-FPM (7.3) processes increase to about 500 at which point it shows to the php-fpm error log "Too many open files" and the web stops serving content until the number of php-fpm processes fpm drops again.
On the server we have PLESK installed with 4 websites (1 website for production and 3 websites for development with the same code an BBDD in each of them).
Server has 96 Gb de RAM and nvme disks.
STEPS TO REPRODUCE
Parameters of configuration file /var/www/vhosts/system/XXXXXXXX/conf/php-fpm.conf is:
[php-fpm-pool-settings]
pm = dynamic
pm.max_children = 1000
pm.start_servers = 100
pm.min_spare_servers = 100
pm.max_spare_servers = 200
pm.max_requests = 2000
Before we have this parameter:
pm.max_children = 500
and got an error like this:
WARNING: [pool XXXXXXXXX] server reached max_children setting (*), consider raising it
and then we go up to 1000 and now we get an error like this:
ERROR: failed to prepare the stderr pipe: Too many open files (24)
Then we add this parameter to php-fpm configuration:
rlimit_files = 65536
and the log kept showing the above error message (Too many open files). Then we raise the value of the parameter again:
rlimit_files = 131072
and now we keep getting the same error in the php-fpm log:
ERROR: failed to prepare the stderr pipe: Too many open files (24)
It seems as if it is ignoring the limit we just imposed on the service php-fpm.
ACTUAL RESULT
Error messages in log /var/www/vhosts/XXXXXX/logs/php-fpm_error_log:
ERROR: failed to prepare the stderr pipe: Too many open files (24)
ERROR: failed to prepare the stderr pipe: Too many open files (24)
When browsing the web at that time, a white screen appears waiting to receive data from the web.
EXPECTED RESULT
That the php-fpm error disappears:
ERROR: failed to prepare the stderr pipe: Too many open files (24)
and that our website is served correctly in thos conditions.