位置: 编程技术 - 正文

/etc/php-fpm.d/www.conf 配置注意事项

编辑:rootadmin

推荐整理分享/etc/php-fpm.d/www.conf 配置注意事项,希望有所帮助,仅作参考,欢迎阅读内容。

文章相关热门搜索词:,内容如对您有帮助,希望把文章链接给更多的朋友!

1、php-fpm 配置文件里 rlimit_files的值 要与系统的打开连接数一致

1)查看系统文件打开连接数

[root@iZeveq0q4Z ~]# ulimit -n

2)查看一下php-fpm 配置文件里 rlimit_files的值

; Set open file descriptor rlimit#rlimit设置打开的文件描述符; Default Value: system defined valuerlimit_files = 如果两个值不一样,则要设置为一样

方法如下:

3)设置系统打开文件连接数

[root@hotdata ~]# ulimit -HSn [root@hotdata ~]# ulimit -n[root@hotdata ~]#

设置好后重启php-fpm服务

2、 request_terminate_timeout = 0 设置为0

; The timeout for serving a single request after which the worker process will; be killed. This option should be used when the ‘max_execution_time' ini option; does not stop script execution for some reason. A value of '0′ means ‘off'.; Available units: s(econds)(default), m(inutes), h(ours), or d(ays); Default Value: 0request_terminate_timeout = 0

/etc/php-fpm.d/www.conf 配置注意事项

因为这个参数会直接杀掉php进程,然后重启php进程,这样前端nginx就会返回: Connection reset by peer。这个过程是很慢,总体感觉就是网站很卡

nginx可能出现recv() failed (: Connection reset by peer) while reading response header from upstream

3、request_slowlog_timeout这个配置不要开启

之前服务器上开始了这个参数,并且设置如下:

request_slowlog_timeout = 导致图片处理每次都失败,每次都是错误。

错误信息如下:

Nginx的错误信息:// :: [error] #0: * recv() failed (: Connection reset by peer) while reading response header from upstream, client: ...,

php-fpm的错误信息为:

[-Dec- ::] WARNING: [pool www] child , script '/hotdata/kehu/foshang_niufeecms/index.php' (request: "GET /index.php") execution timed out (. sec), terminating[-Dec- ::] WARNING: [pool www] child , script '/hotdata/kehu/foshang_niufeecms/index.php' (request: "GET /index.php") execution timed out (. sec), terminating[-Dec- ::] WARNING: [pool www] child exited on signal (SIGTERM) after . seconds from start[-Dec- ::] NOTICE: [pool www] child started[-Dec- ::] WARNING: [pool www] child exited on signal (SIGTERM) after . seconds from start[-Dec- ::] NOTICE: [pool www] child started/var/log/php-fpm/www-slow.log记录如下

[-Dec- ::] [pool www] pid script_filename = /hotdata/kehu/foshang_niufeecms/index.php[0xfff] file_get_contents() /hotdata/kehu/foshang_niufeecms/index/Lib/Action/MemberAction.class.php:[0xfff] makecar() /hotdata/kehu/foshang_niufeecms/index/Lib/Action/MemberAction.class.php:[0xfff6b5bd] ajaxMakeCart() unknown:0[0xffde] invoke() /hotdata/kehu/foshang_niufeecms/core/Lib/Core/App.class.php:[0xffdc] exec() /hotdata/kehu/foshang_niufeecms/core/Lib/Core/App.class.php:[0xffda] run() /hotdata/kehu/foshang_niufeecms/core/Lib/Core/Think.class.php:[0xffc] start() /hotdata/kehu/foshang_niufeecms/core/Common/runtime.php:[0xffbef8] +++ dump failed

所以最好是要这个设置给屏蔽掉。;request_slowlog_timeout =

以上这篇/etc/php-fpm.d/www.conf 配置注意事项就是小编分享给大家的全部内容了,希望能给大家一个参考,也希望大家多多支持积木网。

PHP正则表达式匹配替换与分割功能实例浅析 本文实例讲述了PHP正则表达式匹配替换与分割功能。分享给大家供大家参考,具体如下:正则表达式在PHP中的作用主要包括:分割、匹配、查找与替换

php加密之discuz内容经典加密方式实例详解 本文实例讲述了php加密之discuz内容经典加密方式。分享给大家供大家参考,具体如下:导读:有的时候,我们希望对表里的某些敏感字段进行加密,想了好

PHP进制转换实例分析(2,8,,,进制至进制相互转换) 本文实例讲述了PHP进制转换。分享给大家供大家参考,具体如下:可以实现:进制转换2、8、、、进制2、8、、、进制转换进制有点要注意下

本文链接地址:https://www.jiuchutong.com/biancheng/295402.html 转载请保留说明!

上一篇:PHP strip_tags保留多个HTML标签的方法(php保存session)

下一篇:PHP正则表达式匹配替换与分割功能实例浅析(php正则表达式匹配,返回原因)

免责声明:网站部分图片文字素材来源于网络,如有侵权,请及时告知,我们会第一时间删除,谢谢! 邮箱:opceo@qq.com

鄂ICP备2023003026号

网站地图: 企业信息 工商信息 财税知识 网络常识 编程技术

友情链接: 武汉网站建设 电脑维修 湖南楚通运网络