首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >PHP无法创建足够多的子程序并停止服务请求

PHP无法创建足够多的子程序并停止服务请求
EN

Server Fault用户
提问于 2014-12-26 23:03:44
回答 1查看 5.5K关注 0票数 1

我是PHP的新手,我注意到它似乎只是随机的锁着。

代码语言:javascript
复制
[26-Dec-2014 22:50:16] WARNING: [pool www] seems busy (you may need to increase pm.start_servers, or pm.min/max_spare_servers), spawning 32 children, there are 0 idle, and 921 total children
[26-Dec-2014 22:50:17] WARNING: [pool www] seems busy (you may need to increase pm.start_servers, or pm.min/max_spare_servers), spawning 32 children, there are 0 idle, and 931 total children
[26-Dec-2014 22:50:18] WARNING: [pool www] seems busy (you may need to increase pm.start_servers, or pm.min/max_spare_servers), spawning 32 children, there are 0 idle, and 941 total children
[26-Dec-2014 22:50:19] WARNING: [pool www] seems busy (you may need to increase pm.start_servers, or pm.min/max_spare_servers), spawning 32 children, there are 0 idle, and 951 total children
[26-Dec-2014 22:50:20] WARNING: [pool www] seems busy (you may need to increase pm.start_servers, or pm.min/max_spare_servers), spawning 32 children, there are 0 idle, and 961 total children
[26-Dec-2014 22:50:21] WARNING: [pool www] seems busy (you may need to increase pm.start_servers, or pm.min/max_spare_servers), spawning 32 children, there are 0 idle, and 971 total children
[26-Dec-2014 22:50:22] WARNING: [pool www] seems busy (you may need to increase pm.start_servers, or pm.min/max_spare_servers), spawning 32 children, there are 0 idle, and 981 total children
[26-Dec-2014 22:50:23] WARNING: [pool www] seems busy (you may need to increase pm.start_servers, or pm.min/max_spare_servers), spawning 32 children, there are 0 idle, and 991 total children
[26-Dec-2014 22:50:24] WARNING: [pool www] seems busy (you may need to increase pm.start_servers, or pm.min/max_spare_servers), spawning 32 children, there are 0 idle, and 1001 total children
[26-Dec-2014 22:50:25] WARNING: [pool www] seems busy (you may need to increase pm.start_servers, or pm.min/max_spare_servers), spawning 32 children, there are 0 idle, and 1011 total children
[26-Dec-2014 22:50:26] WARNING: [pool www] seems busy (you may need to increase pm.start_servers, or pm.min/max_spare_servers), spawning 32 children, there are 0 idle, and 1021 total children
[26-Dec-2014 22:50:27] WARNING: [pool www] seems busy (you may need to increase pm.start_servers, or pm.min/max_spare_servers), spawning 32 children, there are 9 idle, and 1031 total children

这似乎是随机发生的(我们可能每分钟或200分钟有50人在这个站点上),而PHP却停止了对请求的服务(从上面看,它似乎无法满足需求)。

即使我重新启动PHP,它也会被锁定很短时间。

代码语言:javascript
复制
[26-Dec-2014 22:52:41] NOTICE: Terminating ...
[26-Dec-2014 22:52:41] NOTICE: exiting, bye-bye!
[26-Dec-2014 22:52:41] NOTICE: fpm is running, pid 17484
[26-Dec-2014 22:52:41] NOTICE: ready to handle connections
[26-Dec-2014 22:53:15] WARNING: [pool www] seems busy (you may need to increase pm.start_servers, or pm.min/max_spare_servers), spawning 8 children, there are 0 idle, and 53 total children
[26-Dec-2014 22:53:16] WARNING: [pool www] seems busy (you may need to increase pm.start_servers, or pm.min/max_spare_servers), spawning 16 children, there are 0 idle, and 61 total children
[26-Dec-2014 22:53:17] WARNING: [pool www] seems busy (you may need to increase pm.start_servers, or pm.min/max_spare_servers), spawning 32 children, there are 0 idle, and 71 total children
[26-Dec-2014 22:53:18] WARNING: [pool www] seems busy (you may need to increase pm.start_servers, or pm.min/max_spare_servers), spawning 32 children, there are 0 idle, and 81 total children
[26-Dec-2014 22:57:01] WARNING: [pool www] seems busy (you may need to increase pm.start_servers, or pm.min/max_spare_servers), spawning 8 children, there are 0 idle, and 109 total children
[26-Dec-2014 22:58:09] WARNING: [pool www] seems busy (you may need to increase pm.start_servers, or pm.min/max_spare_servers), spawning 8 children, there are 0 idle, and 124 total children
[26-Dec-2014 22:58:10] WARNING: [pool www] seems busy (you may need to increase pm.start_servers, or pm.min/max_spare_servers), spawning 16 children, there are 0 idle, and 132 total children
[26-Dec-2014 22:58:11] WARNING: [pool www] seems busy (you may need to increase pm.start_servers, or pm.min/max_spare_servers), spawning 32 children, there are 0 idle, and 142 total children
[26-Dec-2014 22:58:12] WARNING: [pool www] seems busy (you may need to increase pm.start_servers, or pm.min/max_spare_servers), spawning 32 children, there are 0 idle, and 152 total children
[26-Dec-2014 22:58:13] WARNING: [pool www] seems busy (you may need to increase pm.start_servers, or pm.min/max_spare_servers), spawning 32 children, there are 0 idle, and 162 total children
[26-Dec-2014 22:58:14] WARNING: [pool www] seems busy (you may need to increase pm.start_servers, or pm.min/max_spare_servers), spawning 32 children, there are 0 idle, and 172 total children
[26-Dec-2014 22:58:15] WARNING: [pool www] seems busy (you may need to increase pm.start_servers, or pm.min/max_spare_servers), spawning 32 children, there are 0 idle, and 182 total children
[26-Dec-2014 22:58:16] WARNING: [pool www] seems busy (you may need to increase pm.start_servers, or pm.min/max_spare_servers), spawning 32 children, there are 0 idle, and 192 total children
[26-Dec-2014 22:58:17] WARNING: [pool www] seems busy (you may need to increase pm.start_servers, or pm.min/max_spare_servers), spawning 32 children, there are 0 idle, and 202 total children

这是我的设置

代码语言:javascript
复制
pm.max_children = 2000
pm.start_servers = 20
pm.min_spare_servers = 10
pm.max_spare_servers = 200
pm.max_requests = 500

我也试过这些

代码语言:javascript
复制
pm.max_children = 2000
pm.start_servers = 20
pm.min_spare_servers = 20
pm.max_spare_servers = 50
pm.max_requests = 500

和其他几个组合,但仍然看到了问题。

服务器是32核,64 is内存。使用Apache和FastCGI

谢谢

EN

回答 1

Server Fault用户

发布于 2014-12-27 12:06:46

试试这个:

注意:仅当pm设置为“动态”时才使用

pm.start_servers = min_spare_servers + (max_spare_servers - min_spare_servers) /2

代码语言:javascript
复制
pm = dynamic
pm.max_children = 500
pm.start_servers = 60
pm.min_spare_servers = 20
pm.max_spare_servers = 100
pm.max_requests = 10000; 

或者像这样:

代码语言:javascript
复制
pm = ondemand
pm.max_children = 500
pm.max_requests = 10000

不管怎样,你需要使用缓存。

票数 1
EN
页面原文内容由Server Fault提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://serverfault.com/questions/654923

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档