我已经安装了ngix PHP5-fpm.我很高兴,但我不能优化PHP5-fpm,以便它可以正常工作.每个固定错误都会产生不同的错误.
首先,我有默认设置,导致很多错误:
[04-Jun-2012 03:30:06] WARNING: [pool www] server reached pm.max_children setting (5),consider raising it
我增加了所有数字:
pm.max_children = 15
pm.start_servers = 5
pm.min_spare_servers = 3
pm.max_spare_servers = 5
;pm.max_requests = 500
它导致了一个不同的错误:
[28-Feb-2013 07:45:06] WARNING: [pool www] seems busy (you may need to increase pm.start_servers,or pm.min/max_spare_servers),spawning 8 children,there are 18 idle,and 28 total children
我再次增加了所有数字:
pm.max_children = 70
pm.start_servers = 20
pm.min_spare_servers = 20
pm.max_spare_servers = 35
;pm.max_requests = 500
这导致日志文件填满了这个:
[28-Feb-2013 13:21:55] NOTICE: [pool www] child 21868 exited with code 0 after 4171.293476 seconds from start
[28-Feb-2013 13:21:55] NOTICE: [pool www] child 23962 started
我没有注释:
pm.max_requests = 500
我有同样的错误,但不是经常 – 每5分钟:
[28-Feb-2013 13:21:55] NOTICE: [pool www] child 21868 exited with code 0 after 4171.293476 seconds from start
[28-Feb-2013 13:21:55] NOTICE: [pool www] child 23962 started
我确实再次增加:
pm.max_requests = 1000
现在我每小时有2-3次这个错误,但它仍然存在.
我会再次增加这个数字,但我觉得我的服务器(网站)的工作速度比在其他服务器上托管的网站有点慢:pm.max_children = 15,pm.start_servers = 5,pm.min_spare_servers = 3,pm.max_spare_servers = 5.(可能这只是一个网络问题,我不知道).
我搜索了谷歌和这个网站,知道如何计算pm.max_children(它取决于RAM).但我找不到任何有关如何计算的信息:
pm.start_servers
pm.min_spare_servers
pm.max_spare_servers
pm.max_requests
有人可以帮忙吗?
uptime
13:55:39 up 16:40,2 users,load average: 0.13,0.14,0.16
free -m
total used free shared buffers cached
Mem: 24101 3783 20318 0 151 3039
-/+ buffers/cache: 592 23509
Swap: 7811 0 7811
最佳答案
原文链接:https://www.f2er.com/nginx/435461.html