#1 View the error log
#nginx-error-log
tail /var/log/nginx/error.log -n 200
#*289 recv() failed (104: Connection reset by peer) while reading response header from upstream..
# PHP - FPM log
tail /var/log/ php7.2 - FPM. Log - n 200# [pool www] server reached pm.max_children setting (50), consider raising it
Copy the code
#2 Change the number of php-fpm processes
Start by checking the amount of memory used by each PHP-Fpm
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
# # modifiedVim/etc/PHP / 7.2 / FPM/pool. D/www.confCopy the code
pm.max_children
: Indicates the number of phP-fpm processes started in static modepm.start_servers
: Number of phP-fpm processes started in dynamic modepm.min_spare_servers
: Minimum number of phP-FPM processes in dynamic modepm.max_spare_servers
: Maximum number of phP-fPM processes in dynamic mode
pm.max_children = 100
pm.start_servers = 30
pm.min_spare_servers = 20
pm.max_spare_servers = 100
pm.max_requests = 500
Copy the code
Sudo service php7.2 - FPM restartCopy the code
- Myshell. Co. UK/blog / 2012/0…