uWSGI:我遇到了线程模式问题
如果我使用没有线程模式的uWSGI,它工作得很好。但我原来的服务器运行 Apache ServerLimit 1,线程模式。 它可以处理并发连接,但我的uWSGI不能(因为我认为worker只有1)。 所以我尝试打开线程模式,但是我会从nginx收到502 Bad Gateway错误消息。
我的日志显示: uwsgi:Modules / gcmodule.c:277:visit_decref:断言`gc-> gc.gc_refs!= 0'失败。
我不知道出了什么问题,我怎样才能让它发挥作用? 谢谢。
这是我的配置:
[uwsgi]
show-config=True
socket=:8002
pidfile=/var/run/unicorn_uwsgi.pid
daemonize=/root/logs/unicorn_uwsgi.log
vacuum=True
enable-threads=True
threads=40
processes=1
env=QTDIR=/root/lib/qt
env=LD_LIBRARY_PATH=/root/lib/qt/lib
env=DISPLAY=:99
env=XAUTHORITY=/root/webapps/xvfb/Xauthority.xvfb
module=WSGI
home=/root/webapps/unicorn
pythonpath=/root/Source/Server/Unicorn
chdir=/root/Source/Server/Unicorn
我使用 nginx 作为 HTTP 服务器,配置如下:
server {
listen 80;
server_name _;
location / {
include uwsgi_params;
uwsgi_pass 127.0.0.1:8002;
}
}
操作系统:CentOS 6.0,CPU:AMD Athlon(tm) XP 2500+,RAM:2G
Python 2.6.5(默认),uWSGI:0.9.8.2,nginx :0.8.54
If I use uWSGI without threaded mode, it works fine. But my original server run with Apache ServerLimit 1, threaded-mode.
It can handle concurrent connection, but my uWSGI can't (because worker only 1, I think).
So I try to open threaded mode, but I will get 502 Bad Gateway error message from nginx.
My log showed me:
uwsgi: Modules/gcmodule.c:277: visit_decref: Assertion `gc->gc.gc_refs != 0' failed.
I have no idea about what's wrong, How can I make it work?
Thanks.
Here is my configuration:
[uwsgi]
show-config=True
socket=:8002
pidfile=/var/run/unicorn_uwsgi.pid
daemonize=/root/logs/unicorn_uwsgi.log
vacuum=True
enable-threads=True
threads=40
processes=1
env=QTDIR=/root/lib/qt
env=LD_LIBRARY_PATH=/root/lib/qt/lib
env=DISPLAY=:99
env=XAUTHORITY=/root/webapps/xvfb/Xauthority.xvfb
module=WSGI
home=/root/webapps/unicorn
pythonpath=/root/Source/Server/Unicorn
chdir=/root/Source/Server/Unicorn
I use nginx as HTTP server, here is configuration:
server {
listen 80;
server_name _;
location / {
include uwsgi_params;
uwsgi_pass 127.0.0.1:8002;
}
}
OS: CentOS 6.0, CPU: AMD Athlon(tm) XP 2500+, RAM: 2G
Python 2.6.5 (default), uWSGI: 0.9.8.2, nginx: 0.8.54
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
你可以尝试使用centos6提供的PyQt4吗? (从你的配置看来你正在使用pyqt,并且pyqt中有关于此类问题的各种报告)
Can you try with the centos6 supplied PyQt4 ? (from your config it looks like you are using pyqt, and there are various reports on this kind of problem in pyqt)