Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PHP-FPM: pm.process_idle_timeout vs php_admin_value[max_execution_time]

Tags:

php

I have set the FCGI idle timeout value to 120 with -idle-timeout 120 in my Apache site configuration to make sure Apache doesn't time out before my php scripts are finished executing, but now I'm wondering what the difference is between setting php_admin_value[max_execution_time] = 120 and pm.process_idle_timeout = 120s in a php-fpm .conf file?

Does one override the other? Is there a difference? Do I need to set both if I want to make sure my scripts don't time out before the length of time I specify?

Any explanation or reference would be helpful

like image 542
bruchowski Avatar asked Jan 04 '14 20:01

bruchowski


1 Answers

Based on the comments from the file php-fpm.conf.default: pm.process_idle_timeout has nothing to do with script execution. It defines the time a spawned FPM child has to be idle (i.e. not handle a request) before it will be killed. This does not affect script execution in any way (not even sleep()).

PHP: Runtime Configuration: The PHP INI setting max_execution_time defines the maximum process time (CPU time) in seconds after which script execution will be halted. Note: Last time I checked (2 years ago), this did not apply to Windows where the elapsed real time counts.

like image 97
Kontrollfreak Avatar answered Sep 24 '22 12:09

Kontrollfreak