如何解决“mod_fastcgi.c.2566意外结束文件(可能fastcgi进程死了)"调用需要很长时间执行的 .php 时? [英] How to solve "mod_fastcgi.c.2566 unexpected end-of-file (perhaps the fastcgi process died)" when calling .php that takes long time to execute?

查看:31
本文介绍了如何解决“mod_fastcgi.c.2566意外结束文件(可能fastcgi进程死了)"调用需要很长时间执行的 .php 时?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的 php 应用程序中,我恢复了 db2 数据库.它工作正常,但这是一个巨大的 2.9GB,以 500 - Internal Server Error 结束.

In my php application I restore db2 database. It works fine but here is one huge one 2.9GB that finishes with 500 - Internal Server Error.

我使用 exec() 从 .php - cp、db2 等运行 unix shell 命令.从 firefox 或 ruby​​ 脚本运行时会发生同样的错误.

I use exec() to run unix shell commands from .php - cp, db2 etc. The same error happens when running from firefox or ruby script.

我必须先复制备份映像文件,这需要几分钟时间.然后我调用 db2 来恢复图像.对于这个特定的数据库,php 进程以上述错误结束.然后我可以在错误日志文件中找到这个

I have to copy the backup image file first which takes few minutes. Then I call db2 to restored the image. For this particular database the php process finishes with above error. Then I can find this in the error log file

2012-08-02 10:25:18: (mod_fastcgi.c.2566) unexpected end-of-file (perhaps the fastcgi process died): pid: 0 socket: tcp:127.0.0.1:9090
2012-08-02 10:25:18: (mod_fastcgi.c.3352) response not received, request sent: 2758 on socket: tcp:127.0.0.1:9090 for /wrational/tools/rationalTest.php?mode=restore&database=RATIONAL&from_database=dbb&dbbackuptype=weekly, closing connection

我在 php.ini 中将 default_socket_timeoutmax_execution_time 设置为 5660 并确认它是由 phpinfo() 设置的,但它没有看起来没什么帮助.

I set both default_socket_timeout and max_execution_time to 5660 in php.ini and confirmed that it is set by phpinfo() but it doesn't look like it helped.

知道如何使这个工作正常吗?

Any idea how I can make this one work?

看起来它在 40 分钟后就死了.access.log 文件中的相应行看起来像

It looks like it dies after 40mins. The corresponding line in access.log file look like

"GET /rational/tools/rationalTest.php?mode=restore&from_database=dbb&dbbackuptype=weekly HTTP/1.1" 500 369 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:11.0) Gecko/20100101 Firefox/11.0"

推荐答案

看起来 php-fpm.ini 中的 request_terminate_timeout 选项导致了问题.它被设置为30分钟.我将其更改为 0,到目前为止看起来不错.不过还需要做更多的测试.

Looks like request_terminate_timeout option in php-fpm.ini was causing the troubles. It was set to 30 mins. I changed it to 0 and it looks good so far. Need to do more testing though.

; The timeout for serving a single request after which the worker process will
; be killed. This option should 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: 0

这篇关于如何解决“mod_fastcgi.c.2566意外结束文件(可能fastcgi进程死了)"调用需要很长时间执行的 .php 时?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆