1:查看当前的PHP FastCGI进程数是否够用:netstat -anpo | grep "php-cgi" | wc -l
如果实际使用的“FastCGI进程数”接近预设的“FastCGI进程数”,那么,说明“FastCGI进程数”不够用,需要增大。
2:关于php-fpm.conf
php-fpm里面的这两个参数
如果php-cgi在xx时间内有xx个进程因为资源不足退出就平滑重启
<code linux>
; 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
记录下.以后有新的东西继续更新
4 条评论
我没有使用 PHP-FPM,直接使用的 PHP-CGI(子进程数为2,最大处理请求为1),并且是虚拟主机用户分离的。通过在线网站测试在100个并发时延迟有所上升,从没出现过 502。
请问你有更严格的负载测试工具或服务吗?
@Heiher
木有哦!~!
nginx 老是出现这问题,那问题,唉还是不够熟练啊。。
不错的东西,但是对于我来说有点难