PHP-FPM pool,php-fpm Slow execution log, OPEN_BASEDIR,PHP-FPM process management

Source: Internet
Author: User
Tags fpm

The pool of PHP-FPM

Method 1: In a large configuration file unified implementation
Editing a configuration file

Reload Configuration


Method 2: The total number of methods, first in the large configuration file to set a large directory, and then add 2 pool in this directory
1. Editing a large configuration file

2. Configure 2 small configuration files in this directory



Reload configuration, verify pool

PHP-FPM Slow Execution Log

Configuration file

Reload

Vim/data/wwwroot/test.com/sleep.php//writes the following:

Test access effect, 2 seconds before results appear

View Log Results

PHP-FPM definition Open_basedir

Editing a configuration file

Test access results are normal.

Return to the configuration configuration above and deliberately configure the error path

Test again, Access failed

Note Modify the error logging level in the php.ini configuration file

Increase error logging Location

Reload the PHP-FPM configuration file

and add the error log file directory and file, and modify the permissions to 777

Test again


After the test is complete, fix the intentionally wrong configuration file at the beginning

PHP-FPM Process Management

PM = dynamic/Active process management, or static, when it is static, only the maximum number of child processes is active and none else will take effect
Pm.max_children = 50//maximum number of sub-processes, PS aux can be viewed
Pm.start_servers = 20//Number of processes that will start when the service is started
Pm.min_spare_servers = 5//Defines the minimum number of child processes in the idle period, and if this value is reached, the PHP-FPM service automatically derives the new child process.
Pm.max_spare_servers = 35//Defines the maximum number of child processes in the idle period, or, if higher than this value, to start cleaning up idle child processes.
Pm.max_requests = 500//defines the maximum number of requests processed by a child process, that is, a PHP-FPM child process can handle so many requests, and when this value is reached, it exits automatically.

The above values can be defined by themselves

PHP-FPM pool,php-fpm Slow execution log, OPEN_BASEDIR,PHP-FPM process management

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.