Use Baidu to read the original article and translate the Chinese process_control_timeout0 to set the timeout time for the sub-process to receive the multiplexing signals of the main process. available unit: s (seconds), m (minutes), h (hours), or d (days) default unit: s (seconds ). default value: 0 sub-processes receive the main process multiplexing signal, reuse the message... use Baidu to read the original text and translate Chinese characters
Process_control_timeout = 0
Set the timeout time for the sub-process to receive the multiplexing signals of the main process. available unit: s (seconds), m (minutes), h (hours), or d (days) default unit: s (seconds ). default value: 0
What does a sub-process mean by receiving the signal reused by the main process?
When a url request is processed by nginx and sent to php-fpm, how does this process work? Can a php-fpm process contain multiple requests? Do you have any experts to tell me? thank you very much.
Reply content:
Use Baidu to read the original text and translate Chinese characters
Process_control_timeout = 0
Set the timeout time for the sub-process to receive the multiplexing signals of the main process. available unit: s (seconds), m (minutes), h (hours), or d (days) default unit: s (seconds ). default value: 0
What does a sub-process mean by receiving the signal reused by the main process?
When a url request is processed by nginx and sent to php-fpm, how does this process work? Can a php-fpm process contain multiple requests? Do you have any experts to tell me? thank you very much.
Let's briefly talk about the PHP request processing process.
The interaction between Nginx and PHP depends on the CGI interface. because both of them implement the CGI interface, Nginx can send the received request to PHP and obtain the corresponding result from PHP and return it to the client.
The most basic CGI implementation is to create a new PHP process for each request and shut down the process after processing. this method consumes a lot of resources to start and close the process, so the efficiency is not high.
The FastCGI implementation method is introduced, that is, to enable a process to process multiple requests and then disable the process. this method solves the consumption of opening and closing processes for each request. However, FastCGI has a disadvantage because a process can only process one request at the same time. if multiple requests are received at the same time, they can only wait in queue for the FastCGI process to process.
To solve FastCGI, you can only process one request at a time. that is, you can start Multiple FastCGI processes. However, when multiple FastCGI processes are enabled, there is a management problem for these processes, such as how many processes are to be opened and how requests are allocated to these processes as needed. And PHP-FPM is such a management program that manages FastCGI processes. Nginx first passes the request to the PHP-FPM, and then the PHP-FPM selects the appropriate FastCGI processing process for processing.
When the PHP-FPM passes the request to the FastCGI processing process, it involves process reuse. In principle, the PHP-FPM will select the idle FastCGI process to process the request, before processing, the PHP-FPM will send the process reuse signal to the FastCGI process, to make the FastCGI process ready to accept the request and process. However, FastCGI processes are not always able to process requests, that is, they cannot respond to process multiplexing signals (for example, in the case of false positives ), so this parameter indicates how long the PHP-FPM leaves the FastCGI process to respond to the process multiplexing signal, if it times out, the PHP-FPM will choose another way (such as using other FastCGI processes) to process the request.
Fpm full name fastcgi process manager is dedicated to managing fastcgi