A: The pool of PHP-FPM
Continue editing the configuration file
Vim aming.conf//content as follows
[Aming]
Listen =/tmp/aming.sock
listen.mode=666
user = PHP-FPM
Group = PHP-FPM
PM = dynamic
Pm.max_children = 50
Pm.start_servers = 20
Pm.min_spare_servers = 5
Pm.max_spare_servers = 35
Pm.max_requests = 500
Rlimit_files = 1024
/usr/local/php/sbin/php-fpm–t
/ETC/INIT.D/PHP-FPM restart
II: PHP-FPM Slow execution log
vim/usr/local/php-fpm/etc/php-fpm.d/www.conf//Add the following:
Request_slowlog_timeout = 1
Slowlog =/usr/local/php-fpm/var/log/www-slow.log
Configure Nginx Virtual host test.com.conf, change Unix:/tmp/php-fcgi.sock to Unix:/tmp/www.sock
Reload Nginx Service
Vim/data/wwwroot/test.com/sleep.php//writes the following:
<?php echo "Test slow Log"; sleep (2); echo "Done";? >
Curl-x127.0.0.1:80 test.com/sleep.php
Cat/usr/local/php-fpm/var/log/www-slow.log
Three: Open_basedir
vim/usr/local/php-fpm/etc/php-fpm.d/aming.conf//Add the following:
php_admin_value[open_basedir]=/data/wwwroot/aming.com:/tmp/
Create a test PHP script to test
Change aming.conf again, modify the path, test again
Configuration error Log
Test again
Viewing the error log
Four: PHP-FPM Process Management
PM = dynamic/Active process management, also can be static
Pm.max_children = 50//maximum number of sub-processes, PS aux can be viewed
Pm.start_servers = 20//Number of processes that will start when the service is started
Pm.min_spare_servers = 5//Defines the minimum number of child processes in the idle period, and if this value is reached, the PHP-FPM service automatically derives the new child process.
Pm.max_spare_servers = 35//Defines the maximum number of child processes in the idle period, or, if higher than this value, to start cleaning up idle child processes.
Pm.max_requests = 500//defines the maximum number of requests processed by a child process, that is, a PHP-FPM child process can handle so many requests, and when this value is reached, it exits automatically.
PHP-FPM pool, php-fpm slow execution log, Open_basedir, PHP-FPM process Management