问题原文
原帖链接 · i.amniels · CC BY-SA 4.0
My website is running successfully on PHP-FPM with NGINX on Debian. Timeout period is set at 300 seconds for NGINX. This is enough for most pages, but some scripts get stuck. I can't reproduce the issue in testing, so I would like to know where the script is stuck. Can PHP-FPM report the last line number when a time out occurs?
已采纳解答
原帖链接 · Michael Hampton · CC BY-SA 4.0
You can enable the php-fpm slow log. If a request takes more than a configurable amount of time, php-fpm will dump a stack trace to a log file.
An example configuration, which goes into your php-fpm pool configuration file:
slowlog = /var/log/php5/slow.log
request_slowlog_timeout = 5s
In this case, any request that takes more than 5 seconds of wall clock time will get a stack dump into /var/log/php5/slow.log.
Note that the request will continue running.
摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。
