Today I will introduce to you about php-fpm process close and restart command, PHP-FPM is a PHP FastCGI manager, is only for PHP and PHP5.3.3 has integrated php-fpm, it is no longer a third-party package.
Let's first understand what is php-fpm
The PHP-FPM is a PHP FastCGI manager and is only for PHP.
PHP-FPM is actually a patch of PHP source code, designed to integrate FastCGI process management into the PHP package. You must patch it to your PHP source code before using it after compiling and installing PHP. Now we can download the source code tree in the latest PHP 5.3.2 to directly integrate the branch of the PHP-FPM, it is said that the next version will be integrated into the main branch of PHP. Compared with Spawn-FCGI, PHP-FPM has better control over CPU and memory, and the former is easy to crash and must be monitored with crontab, while PHP-FPM has no such troubles.
PHP5.3.3 has already integrated php-fpm and is no longer a third-party package. PHP-FPM provides a better PHP process management method, can effectively control the memory and process, can smoothly load PHP configuration, than spawn-fcgi has more advantages, so it is officially included by PHP. You can enable PHP-fpm with the-enable-FPM parameter in./configure. Use PHP-FPM to control FastCGI processes of PHP-CGI
The master process can understand the following signals:
INT, TERM terminated immediately
QUIT smooth termination
USR1 re-open the log file
USR2 smoothly reloads all worker processes and reloads configuration and binary modules.
Example:
Disable php-fpm:
The Code is as follows: |
Copy code |
Kill-INT 'cat/usr/local/php/var/run/php-fpm.pid' |
Php-fpm restart:
The Code is as follows: |
Copy code |
Kill-USR2 'cat/usr/local/php/var/run/php-fpm.pid' |
View the number of php-fpm processes:
The Code is as follows: |
Copy code |
Ps aux | grep-c php-fpm |
Restart php-fmp (method 2)
Run
The Code is as follows: |
Copy code |
Killall php-fpm |
Run the command again (usr/local/php is the php installation directory)
The Code is as follows: |
Copy code |
/Usr/local/php/sbin/php-fpm & |