CloudFoundryphpbuildpack Performance Tuning

Source: Internet
Author: User
Uses the open-source cf-php-buildpack. Address: github. comdmikusa-pivotalcf-php-build-pack after building an internal apache server, put the required dependency package into the apacher server, and then set the option in buildpack. json changed to the apache server address. Question 1: Use buildpackpush on the command line.

Uses the open-source cf-php-buildpack. Address https://github.com/dmikusa-pivotal/cf-php-build-pack after building an internal apache server, put the required dependency package into the apacher server, and then change option. json in buildpack to build apache server address Question 1: command line using buildpack push

Uses the open-source cf-php-buildpack. Address https://github.com/dmikusa-pivotal/cf-php-build-pack after building an internal apache server, put the required dependency package into the apacher server, and then change option. json in buildpack to the address of the built apache server

Question 1:

After the command line uses buildpack push, it always fails to start. Check the crashlogs and find that the fpm process is not started.

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

Run the command cf files app /. bp/logs/bp. log found that the fpm dependency package was not downloaded at all. Finally, it was located because my apache server does not have the sha1 file. After adding the file, it will return to normal.

Question 2:

Wordpress is used as the test program. After the push is successful, we use the AB of apache for testing. We found that 10000 requests and 500 concurrent requests can only respond to less than 1000 requests .....

An error occurred while viewing the logs of the container in warden:

[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

By adjusting the parameters in the php-fpm.conf file in buildpack

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

Finally, we tested 10000 requests and 500 concurrent requests. All requests can be successful.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.