Today found a very magical thing,
PHP log has a timeout log, but I request_terminate_timeout set is 0, theoretically there should be no time-out.
PHP Fatal error:maximum execution the seconds exceeded in ...
OK, first list the current configuration:
Php-fpm:request_terminate_timeout = 0 Php.ini:max_execution_time = 30
Check out the comments on Request_terminate_timeout in the php-fpm file first
; The timeout for serving a i after which the worker process would; Be killed. This option should is used when the ' max_execution_time ' ini option; Does not stop script execution for some reason. A value of ' 0 ' means ' off '. ; Available units:s (econds) (default), M (inutes), H (ours), or D (ays); Default value:0
This annotation explains that Request_terminate_timeout applies when max_execution_time cannot terminate the script for some reason, the PHP-FPM request is killed. Take a look at the Max_execution_time Note: This sets the maximum execution time allowed for the script to be aborted by the parser, and the default is 30s. It seems that my request should have been max_execution_time this setup to kill.
Well, not to forget, did an experiment:
PHP-FPM request_terminate_timeout Settings |
0 |
15 |
PHP.ini max_execution_time Settings |
30 |
30 |
Execution results |
PHP has fatal error timeout log, HTTP status code is 500 |
PHP has no fatal error timeout log, HTTP status code for 502,PHP-FPM log has killed child process log |
Well, the conclusion is that Web request PHP execution time is controlled by 2 aspects, one is php.ini max_execution_time (note that sleep,http request waiting for response time is not counted, here is the real execution time), the other is PHP-FPM Request_terminate_timeout setting, this is the start of the request n seconds.