First, understand what PHP-FPM is.
PHP-FPM is a PHP fastcgi manager that is used only in PHP.
PHP-FPM is actually a patch of PHP source code, designed to integrate FASTCGI process management into the PHP package. It must be patch to your PHP source code and can be used only after compiling and installing PHP. Now we can download the new PHP 5.3.2 source tree to directly integrate the PHP-FPM branch, it is said that the next version will be merged into the main branch of PHP. Relative SPAWN-FCGI,PHP-FPM in the CPU and memory control is better, and the former is very easy to crash, must be monitored with crontab, and PHP-FPM does not have this annoyance.
PHP5.3.3 has integrated PHP-FPM and is no longer a third party package. PHP-FPM provides a better way to manage PHP processes, can effectively control memory and process, can smooth overload PHP configuration, than spawn-fcgi has more advantages, so by the official PHP included. /configure with –ENABLE-FPM parameters to open the PHP-FPM. Using PHP-FPM to control the fastcgi process of php-cgi
The master process can understand the following signals
INT, TERM immediately terminated
QUIT Smooth Termination
USR1 Reopen the log file
USR2 smooth overload of all worker processes and reload configuration and binary modules
Example:
PHP-FPM off:
The code is as follows |
Copy Code |
Kill-int ' Cat/usr/local/php/var/run/php-fpm.pid ' |
PHP-FPM reboot:
The code is as follows |
Copy Code |
KILL-USR2 ' Cat/usr/local/php/var/run/php-fpm.pid ' |
To view the number of PHP-FPM processes:
The code is as follows |
Copy Code |
PS aux | Grep-c PHP-FPM |
Restart of PHP-FMP (Method II)
Execute first
The code is as follows |
Copy Code |
Killall PHP-FPM |
Re-execution (usr/local/php is the installation directory for PHP)
The code is as follows |
Copy Code |
/USR/LOCAL/PHP/SBIN/PHP-FPM & |