PHP
·
发表于 5年以前
·
阅读量:8301
Ç°ÑÔ
´o¼Ò¶¼ÖªµÀPHP-FPMÄÚÖÃÁË״̬ҳ£¬¿ªÆoºo¿É²e¿´PHP-FPMµÄÏeϸÔËÐÐ״̬£¬¸øPHP-FPMÓÅ»¯´øÀ´°iÖu¡£
´o¿ªphp-fpm.conf,ÅaÖÃphp-fpm״̬ҳѡÏi
pm.status_path = /phpfpm_status
*ÅaÖÃnginx.conf£¬Ìi¼Ó¿ÉÃÎÊserver**
server {
listen 80;
server_name 127.0.0.1;
location /phpfpm_status {
fastcgi_pass 127.0.0.1:9000;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $fastcgi_script_name;
}
}
ÖØÆo»oÖØÔØnginx,ºÍphp-fpm
service php-fpm restart
service nginx restart
*a¯ÀÀÆ÷ÃÎʽa¹u£º**
¿Éͨ¹ý´ø²»Í¬²ÎÊý²e¿´php-fpm statusÊa³o¸ñʽ£º
http://www.foo.bar/status #ĬÈÏ´¿Îı¾
http://www.foo.bar/status?json #json¸ñʽ
http://www.foo.bar/status?html #html¸ñʽ
http://www.foo.bar/status?xml #xml¸ñʽ
#full²ÎÊý¿É²e¿´½ø³ÌÏeϸÐÅÏ¢
http://www.foo.bar/status?full
http://www.foo.bar/status?json&full;
http://www.foo.bar/status?html&full;
http://www.foo.bar/status?xml&full;
PHP-FPM status²ÎÊý˵Ã÷£º
pool ¨C fpm³Ø×ÓÃu³Æ£¬´o¶aÊýΪwww
process manager ¨C ½ø³Ì¹ÜÀi*½Ê½,Öµ£ºstatic, dynamic or ondemand. dynamic
start time ¨C Æo¶¯ÈÕÆÚ,Èç¹ureloadÁËphp-fpm£¬Ê±¼a»a¸uÐÂ
start since ¨C ÔËÐÐʱ³¤
accepted conn ¨C µ±Ç°³Ø×Ó½ÓÊܵÄÇeÇoÊý
listen queue ¨C ÇeÇoµÈ´ý¶ÓÁУ¬Èç¹uÕa¸oÖµ²»Îª0£¬ÄÇôҪÔo¼ÓFPMµÄ½ø³ÌÊýÁ¿
max listen queue ¨C ÇeÇoµÈ´ý¶ÓÁÐ×i¸ßµÄÊýÁ¿
listen queue len ¨C socketµÈ´ý¶ÓÁ㤶È
idle processes ¨C ¿ÕÏнø³ÌÊýÁ¿
active processes ¨C »iÔ¾½ø³ÌÊýÁ¿
total processes ¨C ×ܽø³ÌÊýÁ¿
max active processes ¨C ×i´oµÄ»iÔ¾½ø³ÌÊýÁ¿£¨FPMÆo¶¯¿ªÊ¼Ëa£(C)
max children reached - ´oµÀ½ø³Ì×i´oÊýÁ¿ÏÞÖƵĴÎÊý£¬Èç¹uÕa¸oÊýÁ¿²»Îª0£¬ÄÇ˵Ã÷ÄaµÄ×i´o½ø³ÌÊýÁ¿Ì«Ð¡ÁË£¬Çe¸Ä´oÒ»µa¡£
slow requests ¨C ÆoÓÃÁËphp-fpm slow-log£¬»ºÂýÇeÇoµÄÊýÁ¿
×ܽa
ÒÔÉϾÍÊÇÕaƪÎÄÕµÄÈ«²¿ÄÚÈÝÁË£¬Ï£Íu±¾ÎĵÄÄÚÈݶԴo¼ÒµÄѧϰ»oÕß¹¤×÷ÄÜ´øÀ´Ò»¶¨µÄ°iÖu£¬Èç¹uÓÐÒÉÎÊ´o¼Ò¿ÉÒÔÁoÑÔ½»Á÷¡£