PHP-FPM Timeout time setting Request_terminate_timeout analysis

Source: Internet
Author: User
Tags fpm mongodb postgresql stop script
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.

Alibaba Cloud Hot Products

Elastic Compute Service (ECS) Dedicated Host (DDH) ApsaraDB RDS for MySQL (RDS) ApsaraDB for PolarDB(PolarDB) AnalyticDB for PostgreSQL (ADB for PG)
AnalyticDB for MySQL(ADB for MySQL) Data Transmission Service (DTS) Server Load Balancer (SLB) Global Accelerator (GA) Cloud Enterprise Network (CEN)
Object Storage Service (OSS) Content Delivery Network (CDN) Short Message Service (SMS) Container Service for Kubernetes (ACK) Data Lake Analytics (DLA)

ApsaraDB for Redis (Redis)

ApsaraDB for MongoDB (MongoDB) NAT Gateway VPN Gateway Cloud Firewall
Anti-DDoS Web Application Firewall (WAF) Log Service DataWorks MaxCompute
Elastic MapReduce (EMR) Elasticsearch

Alibaba Cloud Free Trail

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.