1、php-fpm 配置文件里 rlimit_files的值 要与系统的打开连接数一致
1)查看系统文件打开连接数
[root@iZ94eveq0q4Z ~]# ulimit -n
65535
2)查看一下php-fpm 配置文件里 rlimit_files的值
; Set open file descriptor rlimit#rlimit设置打开的文件描述符
; Default Value: system defined value
rlimit_files = 65535
如果两个值不一样,则要设置为一样
方法如下:
3)设置系统打开文件连接数
[root@hotdata ~]# ulimit -HSn 65535
[root@hotdata ~]# ulimit -n
65535
[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: 0
request_terminate_timeout = 0
因为这个参数会直接杀掉php进程,然后重启php进程,这样前端nginx就会返回104: Connection reset by peer。这个过程是很慢,总体感觉就是网站很卡
nginx可能出现502
recv() failed (104: Connection reset by peer) while reading response header from upstream
3、request_slowlog_timeout这个配置不要开启
之前服务器上开始了这个参数,并且设置如下:
request_slowlog_timeout = 10导致图片处理每次都失败,每次都是502错误。
错误信息如下:
Nginx的错误信息:
2015/12/28 16:20:23 [error] 649#0: *9862 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: 163.177.69.13,
php-fpm的错误信息为:
[28-Dec-2015 17:04:01] WARNING: [pool www] child 10520, script '/hotdata/kehu/foshang_niufeecms/index.php' (request: "GET /index.php") execution timed out (10.451550 sec), terminating
[28-Dec-2015 17:04:01] WARNING: [pool www] child 10512, script '/hotdata/kehu/foshang_niufeecms/index.php' (request: "GET /index.php") execution timed out (12.396650 sec), terminating
[28-Dec-2015 17:04:01] WARNING: [pool www] child 10520 exited on signal 15 (SIGTERM) after 73.413706 seconds from start
[28-Dec-2015 17:04:01] NOTICE: [pool www] child 10909 started
[28-Dec-2015 17:04:01] WARNING: [pool www] child 10512 exited on signal 15 (SIGTERM) after 73.421170 seconds from start
[28-Dec-2015 17:04:01] NOTICE: [pool www] child 10910 started/var/log/php-fpm/www-slow.log记录如下
[28-Dec-2015 16:23:17] [pool www] pid 2427
script_filename = /hotdata/kehu/foshang_niufeecms/index.php
[0x00007f94070ff668] file_get_contents() /hotdata/kehu/foshang_niufeecms/index/Lib/Action/MemberAction.class.php:516
[0x00007f94070ff140] makecar() /hotdata/kehu/foshang_niufeecms/index/Lib/Action/MemberAction.class.php:623
[0x00007fff6b5bd870] ajaxMakeCart() unknown:0
[0x00007f94070fde48] invoke() /hotdata/kehu/foshang_niufeecms/core/Lib/Core/App.class.php:171
[0x00007f94070fdc70] exec() /hotdata/kehu/foshang_niufeecms/core/Lib/Core/App.class.php:207
[0x00007f94070fda98] run() /hotdata/kehu/foshang_niufeecms/core/Lib/Core/Think.class.php:39
[0x00007f94070fc610] start() /hotdata/kehu/foshang_niufeecms/core/Common/runtime.php:242
[0x00007f94070fbef8] +++ dump failed
所以最好是要这个设置给屏蔽掉。
;request_slowlog_timeout = 10
以上这篇/etc/php-fpm.d/www.conf 配置注意事项就是小编分享给大家的全部内容了,希望能给大家一个参考,也希望大家多多支持。
免责声明:本站资源来自互联网收集,仅供用于学习和交流,请遵循相关法律法规,本站一切资源不代表本站立场,如有侵权、后门、不妥请联系本站删除!
更新日志
- 张真.1993-失恋十四行【上华】【WAV+CUE】
- 钟明秋《爱有天意HQCD》[低速原抓WAV+CUE]
- 孙云岗唢呐《金声玉振[HIFI珍藏版]》[低速原抓WAV+CUE]
- 谭艳精讯TEST-CD试音39号》2CD[DTS-WAV]
- 姚璎格《发烧女中音》DSD版[低速原抓WAV+CUE][1G]
- 张玮伽《微风细雨DSD》发烧大碟[WAV+CUE][1.1G]
- 群星《2024好听新歌14》十倍音质 U盘音乐 [WAV分轨][966M]
- s14全球总决赛T1战队队员都有谁 LOLs14全球总决赛T1战队介绍
- 英雄联盟faker身价有10亿吗 英雄联盟faker身价介绍一览
- faker大魔王称号怎么来的 faker大魔王称号来源介绍
- PS5 Pro上的蒂法更美了!博主盛赞新机1000%值得购买
- 腾讯互娱再离职一员大将!或因供应商贪腐
- Ayaneo3游戏掌机预热:旗舰定位、造型圆润自带底键
- 动力火车.1999-背叛情歌【上华】【WAV+CUE】
- 刘力扬.2019-Neon.Lit虹【摩登天空】【FLAC分轨】