如果我在没有线程模式的情况下使用 uWSGI,它可以正常工作。但是我的原始服务器使用 Apache ServerLimit 1,线程模式运行。它可以处理并发连接,但我的 uWSGI 不能(因为我认为只有 1 个工人)。所以我尝试打开线程模式,但我会从 nginx 收到 502 Bad Gateway 错误消息。
我的日志显示:uwsgi: Modules/gcmodule.c:277: visit_decref: Assertion `gc->gc.gc_refs != 0' failed。
我不知道出了什么问题,我怎样才能让它工作?谢谢。
这是我的配置:
[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+,内存:2G
Python 2.6.5(默认),uWSGI:0.9.8.2,nginx:0.8.54