1

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?

i.amniels
  • 325
  • 1
  • 4
  • 9

1 Answers1

1

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.

Michael Hampton
  • 244,070
  • 43
  • 506
  • 972