Enable the slowlog log of php-fpm, view the php file that has been executed for too long, and terminate the process that has been executed for too long! See how it works! The specific operation method is also simple, modify a file, execute the command: # The viusrlocalphpetcphp-fpm.confPHP5.3.3 version before the settings are as follows: Thetimeout (
Enable the slow log of php-fpm, view php files that have been executed for too long, and terminate the processes that have been executed for too long! See how it works! The specific operation method is also simple, modify a file, execute The command: # vi/usr/local/php/etc/php-fpm.conf PHP 5.3.3 earlier version settings are as follows: The timeout (
Enable slow log of php-fpmLogs, ViewRunPHP files that are too long, andRunA process that is too long can be terminated directly! See how it works!
The specific operation method is also simple. You can modify an object,RunCommand: # vi/usr/local/php/etc/php-fpm.conf
PHP versions earlier than 5.3.3 are set as follows:
The timeout (in seconds) for serving a single request after which the worker process will be terminated Should be used when 'max_execution_time' ini option does not stop script execution for some reason '0s' means 'off'
10s
The timeout (in seconds) for serving of single request after which a php backtrace will be dumped to slow.log file '0s' means 'off'
1s
The log file for slow requests
logs/slow.log
PHP 5.3.3 and later versions are set as follows:
; The timeout for serving a single request after which a PHP backtrace will be; dumped to the 'slowlog' file. A value of '0s' means 'off '.; available units: s (econds) (default), m (inutes), h (ours), or d (ays); Default Value: 0request_slowlog_timeout = 1 s (RunMore than 1 s of php scriptsLogsRecord); The log file for slow requests; Default Value: /usr/local/php/var/log/php-fpm.log.slowslowlog =/usr/local/php/var/log/php-fpm.log.slow (turn on slowRunLogs,LogsThe directory path must exist correctly, otherwise an error will be reported); the timeout for serving a single request after which The worker process will; be killed. this option shoshould be 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: 0request_terminate_timeout = 30 s (when a php scriptRunTerminate the php script after 30 seconds)
Note:Request_terminate_timeout willRunA process that is too long can be terminated directly.
Request_slowlog_timeout willRunSlow file writingLogs
In the future, depending on the slow speedRunLogs/Usr/local/php/var/log/slow. log to optimizeProgramFile!