Last active
December 18, 2019 04:37
-
-
Save ursuleacv/2b7c24c24ea8a15019a1422c3b8a5ecd to your computer and use it in GitHub Desktop.
Adjusting child processes for PHP-FPM (Nginx)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Alternate way to find php-fpm size in human readable format. | |
ps -eo size,pid,user,command --sort -size | awk '{ hr=$1/1024 ; printf("%13.2f Mb ",hr) } { for ( x=4 ; x<=NF ; x++ ) { printf("%s ",$x) } print "" }' | grep php-fpm | |
pm.max_children = Total RAM dedicated to the web server / MAXIMUM child process size - in my case it was 85MB | |
The server has 8GB of RAM, so: | |
pm.max_children = 6144MB / 85MB = 72 | |
pm.max_children = 70 | |
pm.start_servers = 20 | |
pm.min_spare_servers = 20 | |
pm.max_spare_servers = 35 | |
pm.max_requests = 500 | |
https://myshell.co.uk/blog/2012/07/adjusting-child-processes-for-php-fpm-nginx/ | |
https://serverpilot.io/community/articles/how-to-change-the-php-fpm-max_children-setting.html |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment