【CentOS7LNMP架构38】,php-fpm慢执行日志#180110

hellopasswd

创新互联建站专业为企业提供玉门网站建设、玉门做网站、玉门网站设计、玉门网站制作等企业网站建设、网页设计与制作、玉门企业网站模板建站服务,十余年玉门做网站经验,不只是建网站,更提供有价值的思路和整体网络服务。
php -fpm慢执行日志

vi /usr/local/php-fpm/etc/php-fpm.d/www.conf request_slowlog_timeout=1 slowlog=/usr/local/php-fpm/var/log/www-slow.log

配置nginx的虚拟主机test.com.conf,把unix:/tmp/php-fcgi.sock改为unx:/tmp/www.sock

重新加载nginx服务

vi /data/wwwroot/test.com/sleep.php

curl -x 127.0.0.1:80 test.com/sleep.php

cat /usr/local/php-fpm/var/log/www-slow.log

[root@localhost php-fpm.d]# vi www.conf 1 [www] 2 listen = /tmp/php-fcgi.sock 3 listen.mode = 666 4 user = php-fpm 5 group = php-fpm 6 pm = dynamic 7 pm.max_children = 50 8 pm.start_servers = 20 9 pm.min_spare_servers = 5 10 pm.max_spare_servers = 35 11 pm.max_requests = 500 12 rlimit_files = 1024 13 request_slowlog_timeout = 1 14 slowlog = /usr/local/php-fpm/var/log/www-slow.log [root@localhost php-fpm.d]# /usr/local/php-fpm/sbin/php-fpm -t [10-Jan-2018 08:13:55] NOTICE: configuration file /usr/local/php-fpm/etc/php-fpm.conf test is successful [root@localhost php-fpm.d]# /etc/init.d/php-fpm reload Reload service php-fpm done

[root@localhost php-fpm.d]# ls /usr/local/php-fpm/var/log/ php-fpm.log www-slow.log [root@localhost php-fpm.d]# vi /data/wwwroot/test.com/sleep.php 1

[root@localhost php-fpm.d]# curl -x 127.0.0.1:80 test.com/sleep.php

[root@localhost php-fpm.d]# vi /usr/local/php-fpm/etc/php.ini /display_errors 462 ; Default Value: On 463 ; Development Value: On 464 ; Production Value: Off 465 ; http://php.net/display-errors 466 display_errors = Off 467 468 ; The display of errors which occur during PHP\'s startup sequence are handled 469 ; separately from display_errors. PHP\'s default behavior is to suppress those 470 ; errors from clients. Turning the display of startup errors on can be useful in 471 ; debugging configuration problems. We strongly recommend you 472 ; set this to \'off\' for production servers. 473 ; Default Value: Off

将display_errors = Off改为On

[root@localhost php-fpm.d]# vi /usr/local/php-fpm/etc/php.ini /display_errors 462 ; Default Value: On 463 ; Development Value: On 464 ; Production Value: Off 465 ; http://php.net/display-errors 466 display_errors = On 467 468 ; The display of errors which occur during PHP\'s startup sequence are handled 469 ; separately from display_errors. PHP\'s default behavior is to suppress those 470 ; errors from clients. Turning the display of startup errors on can be useful in 471 ; debugging configuration problems. We strongly recommend you 472 ; set this to \'off\' for production servers. 473 ; Default Value: Off [root@localhost php-fpm.d]# /etc/init.d/php-fpm reload Reload service php-fpm done

[root@localhost php-fpm.d]# curl -x 127.0.0.1:80 test.com/sleep.php [root@localhost php-fpm.d]# cat /usr/local/php-fpm/var/log/www-slow.log



新闻名称:【CentOS7LNMP架构38】,php-fpm慢执行日志#180110
链接分享:http://scjbc.cn/article/cpjidp.html

其他资讯