我发现,在成功申请几个php页面之后,页面加载时间似乎减慢,最终不加载,并给出504。
除了这个在php5-fpm日志中找不到任何相关的错误
[13-Dec-2013 17:53:41] WARNING: [pool web36] child 6797 exited on signal 9 (SIGKILL) after 3165.155870 seconds from start [13-Dec-2013 17:53:41] NOTICE: [pool web36] child 8078 started [13-Dec-2013 17:55:15] WARNING: [pool web36] child 7848 exited on signal 9 (SIGKILL) after 633.767987 seconds from start [13-Dec-2013 17:55:15] NOTICE: [pool web36] child 8100 started [13-Dec-2013 17:56:19] WARNING: [pool web36] child 7914 exited on signal 11 (SIGSEGV) after 455.341786 seconds from start
我应该如何排除故障?
Ubuntu 12.04.1 LTS(GNU / Linux 3.2.0-31-generic x86_64)带有Suhosin-Patch的PHP 5.3.10-1ubuntu3.5 nginx / 1.1.19
当你的php脚本花费太多时间(超过60秒)时,Nginx会抛出一个504网关超时。
可以优化php脚本或增加nginx fastcgi_read_timeout参数( http://nginx.org/en/docs/http/ngx_http_fastcgi_module.html )。
例:
location ~ /(index).php { fastcgi_read_timeout 3m; fastcgi_pass 127.0.0.1:8888; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_param PATH_INFO $fastcgi_script_name; include fastcgi_params; }