全球主机交流论坛

标题: lnmp 502错误解决方案 [打印本页]

作者: puper    时间: 2010-11-28 21:09
标题: lnmp 502错误解决方案
php-fpm里面的这两个参数
如果php-cgi在xx时间内有xx个进程因为资源不足退出就平滑重启

; If this number of child processes exit with SIGSEGV or SIGBUS within the time
; interval set by emergency_restart_interval then FPM will restart. A value
; of '0' means 'Off'.
; Default Value: 0
emergency_restart_threshold = 5

; Interval of time used by emergency_restart_interval to determine when
; a graceful restart will be initiated.  This can be useful to work around
; accidental corruptions in an accelerator's shared memory.
; Available Units: s(econds), m(inutes), h(ours), or d(ays)
; Default Unit: seconds

这个修改后运行一段时间,确实有效

还有一种是监听两个php-cgi端口
; Default Value: 0,一个设为backup,写个python程序中转backup的请求,同时重启另一个php-fpm
emergency_restart_interval = 120
作者: cnweb    时间: 2010-11-28 21:14
咱用LAMP
不存在这样的问题
作者: qiqi13245    时间: 2010-11-28 21:14
原帖由 cnweb 于 2010-11-28 21:14 发表
咱用LAMP
不存在这样的问题

作者: xtmp    时间: 2010-11-28 21:16
以暴制暴的方法,不好
作者: serverpoint    时间: 2010-11-28 21:21
提示: 作者被禁止或删除 内容自动屏蔽
作者: skycms    时间: 2010-11-28 21:27
LAMP 真的很好吗?
作者: yaoe    时间: 2010-11-28 21:40
LNAMP更好
作者: hz555    时间: 2010-11-28 21:49
都很好用·········
作者: GoTop    时间: 2010-11-29 00:26
楼主的意思是设置php-fpm成这样:
emergency_restart_threshold = 5
emergency_restart_interval = 120

然后就可以了?

我的php-fpm原来的设置是这样的:
    <value name="emergency_restart_threshold">10</value>
    <value name="emergency_restart_interval">1m</value>

还需要改成你的设置吗?

[ 本帖最后由 GoTop 于 2010-11-29 00:27 编辑 ]
作者: Globalization    时间: 2010-11-29 00:33

作者: monface    时间: 2010-11-29 15:21
其实看不大懂




欢迎光临 全球主机交流论坛 (https://sunk.eu.org/) Powered by Discuz! X3.4