Django/Lighttpd 停止响应并返回 500 错误
我有一个表现相当良好的 Web 应用程序,它已经相当稳定地运行了几个月,但我们每隔一段时间就会看到 django 应用程序停止响应,并且 lighttpd 服务器开始抛出 500 错误。
/var/log/lighttpd/error.log 看起来像:
2011-03-06 18:20:17: (server.c.1469) server stopped by UID = 0 PID = 32106
2011-03-06 18:20:18: (log.c.97) server started
2011-03-08 03:13:12: (mod_fastcgi.c.2494) unexpected end-of-file (perhaps the fastcgi process died): pid: 0 socket: unix:/opt/app/var/app.sock
2011-03-08 03:13:12: (mod_fastcgi.c.3326) response not received, request sent: 608 on socket: unix:/opt/app/var/app.sock for /app.fcgi , closing connection
然后只是重复最后两行,直到我重新启动 django 应用程序为止。
我们将应用程序设置为通过电子邮件向我们发送有关 500 个错误的堆栈跟踪信息,它确实做到了,但在问题开始时却没有。
lighttpd.conf 的 fcgi 部分如下所示:
fastcgi.server = (
"/" + project-name + ".fcgi" => (
"main" => (
"socket" => project-root + "/var/" + project-name + ".sock",
"check-local" => "disable",
"min-proces" => 4,
"max-load-per-proc" => 3,
"broken-scriptfilename" => "enable",
)
),
)
有谁知道如何追踪正在发生的事情吗?我怀疑 lighttpd 和我们的应用程序之间存在一些问题,或者应用程序可能执行了错误的操作,从而导致了这种情况的发生,但我现在不知道该去哪里查看。
I've got a fairly well behaved web application that has been running fairly stably for a few months, but every once in a we've seen the django application stop responding, and the lighttpd server starts spewing 500 errors.
/var/log/lighttpd/error.log looks like:
2011-03-06 18:20:17: (server.c.1469) server stopped by UID = 0 PID = 32106
2011-03-06 18:20:18: (log.c.97) server started
2011-03-08 03:13:12: (mod_fastcgi.c.2494) unexpected end-of-file (perhaps the fastcgi process died): pid: 0 socket: unix:/opt/app/var/app.sock
2011-03-08 03:13:12: (mod_fastcgi.c.3326) response not received, request sent: 608 on socket: unix:/opt/app/var/app.sock for /app.fcgi , closing connection
And then just the repeated last two lines as far as the eye can see until I restart the django application.
We have the application set up to email us stack traces on 500 errors, which it does, but not when this problem starts.
The fcgi section of lighttpd.conf looks like:
fastcgi.server = (
"/" + project-name + ".fcgi" => (
"main" => (
"socket" => project-root + "/var/" + project-name + ".sock",
"check-local" => "disable",
"min-proces" => 4,
"max-load-per-proc" => 3,
"broken-scriptfilename" => "enable",
)
),
)
Does anyone have any ideas about how to track down what's going on? I suspect we have some issue between lighttpd and our application, or maybe the application does something incorrectly which causes this to occur, but I'm at a loss as to where to look now.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您是否尝试过在 django 应用程序中进行一些调试以查看套接字在那一侧正在做什么?据推测,它确实看到了传入的请求,但没有响应?
您遇到的错误发生在 fcgi_demux_response() 中 - 基本上 Lighttpd 没有响应......
Have you tried putting some debug in the django app to see what the socket is doing on that side? Presumably it does see the requests comming in, but is not responding?
The error you are getting occurs in fcgi_demux_response() - basicaly Lighttpd gets no response ....