首页 > php教程 > php手册 > CloudFoundry php buildpack 性能调优

CloudFoundry php buildpack 性能调优

WBOY
发布: 2016-06-06 19:58:40
原创
1186 人浏览过

采用了开源的cf-php-buildpack。 地址 https://github.com/dmikusa-pivotal/cf-php-build-pack 搭建内部apache 服务器后,将需要的依赖包放入apacher服务器,然后将buildpack中的option.json修改为搭建的apache服务器地址 问题1: 命令行 使用buildpack push

   采用了开源的cf-php-buildpack。 地址https://github.com/dmikusa-pivotal/cf-php-build-pack    搭建内部apache 服务器后,将需要的依赖包放入apacher服务器,然后将buildpack中的option.json修改为搭建的apache服务器地址

  

  问题1:  

  命令行 使用buildpack push 后,总是启动失败,查看crashlogs,发现fpm进程 没有启动

 Reading logs/stdout.log... OK
 06:51:32 php-fpm      | /bin/sh: /home/vcap/app/php/sbin/php-fpm: not found
06:51:32 php-fpm-logs | tail: cannot open `/home/vcap/app/../logs/php-fpm.log' for reading: No such file or directory

 使用 命令 cf files app/.bp/logs/bp.log  发现根本就没有下载 fpm 依赖包,最后定位出,是因为我的apache 服务器中没有 sha1  文件,增加后,恢复正常

 

问题2 :

      使用了wordpress 作为测试程序,push成功后,使用apache自带的ab进行测试,发现 10000个请求,500并发只能响应成功不到1000个。。。。。

      查看warden内 container 的日志 出现错误:

 [16-May-2014 07:14:45] WARNING: [pool www] pm.start_servers is not set. It's been set to 7.
[16-May-2014 07:14:45] NOTICE: fpm is running, pid 46
[16-May-2014 07:14:45] NOTICE: ready to handle connections
[16-May-2014 07:16:30] 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 14 total children
[16-May-2014 07:16:31] 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 19 total children
[16-May-2014 07:16:32] 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 24 total children
[16-May-2014 07:16:33] 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 29 total children
[16-May-2014 07:16:34] WARNING: [pool www] server reached pm.max_children setting (5), consider raising it

 

通过调整 buildpack中的php-fpm.conf 文件中的参数

pm.max_children = 30

; The number of child processes created on startup.
; Note: Used only when pm is set to 'dynamic'
; Default Value: min_spare_servers + (max_spare_servers - min_spare_servers) / 2
pm.start_servers =

; The desired minimum number of idle server processes.
; Note: Used only when pm is set to 'dynamic'
; Note: Mandatory when pm is set to 'dynamic'
pm.min_spare_servers = 5

; The desired maximum number of idle server processes.
; Note: Used only when pm is set to 'dynamic'
; Note: Mandatory when pm is set to 'dynamic'
pm.max_spare_servers = 10

 

最后测试,10000个请求,500并发,可以全部请求成功。

 

相关标签:
来源:php.cn
本站声明
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn
热门推荐
热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板