优雅的重启php-fpm

首先查看php-fpm 进程

ps -aux | grep php
root     14742  0.0  0.0 186456  5728 ?        Ss   Jul24   0:05 php-fpm: master process (/usr/local/php/conf/php-fpm.conf)
nginx    14743  0.0  0.0 186728  7656 ?        S    Jul24   0:00 php-fpm: pool www
nginx    14744  0.0  0.0 186728  7764 ?        S    Jul24   0:00 php-fpm: pool www
nginx    14745  0.0  0.0 186728  7656 ?        S    Jul24   0:00 php-fpm: pool www
nginx    14746  0.0  0.0 186728  7756 ?        S    Jul24   0:00 php-fpm: pool www
nginx    14747  0.0  0.0 186728  7660 ?        S    Jul24   0:00 php-fpm: pool www
nginx    14748  0.0  0.0 186728  7760 ?        S    Jul24   0:00 php-fpm: pool www
nginx    14749  0.0  0.0 186728  7756 ?        S    Jul24   0:00 php-fpm: pool www
nginx    14750  0.0  0.0 186456  5416 ?        S    Jul24   0:00 php-fpm: pool www
nginx    14751  0.0  0.0 186456  5416 ?        S    Jul24   0:00 php-fpm: pool www
nginx    14752  0.0  0.0 186728  7660 ?        S    Jul24   0:00 php-fpm: pool www
nginx    14753  0.0  0.0 186456  5416 ?        S    Jul24   0:00 php-fpm: pool www
nginx    14754  0.0  0.0 186456  5416 ?        S    Jul24   0:00 php-fpm: pool www
nginx    14755  0.0  0.0 186456  5416 ?        S    Jul24   0:00 php-fpm: pool www
nginx    14756  0.0  0.0 186728  7768 ?        S    Jul24   0:00 php-fpm: pool www
nginx    14757  0.0  0.0 186728  7660 ?        S    Jul24   0:00 php-fpm: pool www
root     19845  0.0  0.0 112708   964 pts/0    S+   10:41   0:00 grep --color=auto php

优雅的重启php-fpm:

kill -USR2 14742

OK了。

 

php-fpm 关闭:

kill -INT 'cat /usr/local/php/var/run/php-fpm.pid'


php-fpm 重启:
 

kill -USR2 'cat /usr/local/php/var/run/php-fpm.pid'

 

你可能感兴趣的:(php)