The real meaning of php-fpm optimization method pm.min_spare_servers and Pm.max_spare_servers

Source: Internet
Author: User
Tags fpm

Original address: http://blog.itpub.net/14184018/viewspace-1797411/

PHP-FPM Process Pool Optimization method

There are two ways to PHP-FPM process pool opening process, one is static, the direct opening of a specified number of PHP-FPM process, no longer increase or decrease;
The other is dynamic, starting with a certain number of php-fpm process, when the request is large, dynamically increase the number of PHP-FPM process to the upper limit, when idle automatically release the number of idle processes to a lower limit.
These two different methods of execution can be adjusted according to the actual requirements of the server.

Some of the parameters to use are PM, Pm.max_children, Pm.start_servers, Pm.min_spare_servers, and Pm.max_spare_servers.

PM indicates that in that way, there are two values that can be selected, either static (static) or dynamic.

The following 4 parameters mean:
Pm.max_children: The number of PHP-FPM processes that are open in a static manner, and in the dynamic way he limits the maximum number of PHP-FPM processes (note that the Pm.max_spare_servers value can only be less than or equal to Pm.max_children)
Pm.start_servers: The number of starting PHP-FPM processes in dynamic mode.
Pm.min_spare_servers: The minimum number of PHP-FPM processes in dynamic idle state.
Pm.max_spare_servers: The maximum number of PHP-FPM processes in dynamic idle state.

If the DM is set to static, then only pm.max_children this parameter is in effect. The system will open the PHP-FPM process for the number of parameters set.

The

is in effect if the DM is set to dynamic,4 parameters. The system starts the Pm.start_servers PHP-FPM process at the start of the PHP-FPM run and then dynamically pm.min_spare_servers and pm.max_spare_ according to the requirements of the system Adjusts the number of PHP-FPM processes between servers.
P.S
Pm.min_spare_servers, pm.max_spare_servers these 2 parameters at first I thought it was an idle process, but then the server gave me an error:
Pm.start_servers (70) must not to less than pm.min_spare_servers (a) and not greater than-pm.max_spare_servers (a)
request Pm.start_ The servers values between Pm.min_spare_servers and pm.max_spare_servers are tested to draw the conclusion.

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.