PHP-FPM time-out setting Request_terminate_timeout analysis

Source: Internet
Author: User
Tags fpm stop script

Before I found a PHP configuration about returning 500 and 502 questions, today saw a brother wrote very well, recorded. There is a time-out log in the  php log, but my request_terminate_timeout is set to 0, theoretically there should be no time-out.  php Fatal error:  Maximum execution time of seconds exceeded in ...  ok, first list current configuration:  php-fpm:request_ Terminate_timeout = 0php.ini:max_execution_time = 30  First Look at the comments about Request_terminate_timeout in the php-fpm file  ; The timeout for serving a single request after which the worker process would; Be killed. This option should is used when the ' max_execution_time ' ini option; Does not a stop script execution for some reason. A value of ' 0 ' means ' off '.; Available units:s (econds) (default), M (inutes), H (ours), or D (ays); The Default value:0   note shows that Request_terminate_timeout applies when max_execution_time cannot terminate the script for some reason, Will kill the PHP-FPM request. Take a look at Max_execution_time's note: This sets the maximum allowable execution time before the script is aborted by the parser, which defaults to 30s. It seems that my request should have been killed by max_execution_time this setting.   Well, don't forget, do 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 No fatal error time-out log, HTTP status code for 502,PHP-FPM log to kill the child process log
Well, the conclusion is that the Web request PHP execution time is controlled by 2 aspects, one is PHP.ini's max_execution_time (note that the Sleep,http request waits for the response time is not counted, here is calculates the real execution time), the other is PHP-FPM Request_terminate_timeout is set, this calculates the request to start n seconds.

PHP-FPM time-out setting Request_terminate_timeout analysis

Related Article

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.