- Plesk 12.5 for Linux
- Plesk for Linux
How to apply PHP-FPM pool setting pm.max_children for all the domains?
- Download the script:
# wget https://plesk.zendesk.com/hc/article_attachments/115000895634/update_max_children.sh
- Add execution permission for the script:
# chmod +x ./update_max_children.sh
- Execute the script:
If you need to calculate and change max_children value based on the amount of memory on the system the following command will help us to determine the memory used by each (PHP-FPM) child process:
# ps -ylC php-fpm --sort:rss
The RSS column shows non-swapped physical memory usage by PHP-FPM processes in kilo Bytes.
If on an average each PHP-FPM process takes ~85MB of RAM on your server, appropriate value for pm.max_children can be calculated as:
pm.max_children = Total RAM dedicated to the web server / Max child process size
The server has 8GB of RAM, so:
pm.max_children = 6144MB / 85MB = 72