スレッド モードなしで 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
HTTP サーバーとして nginx を使用します。設定は次のとおりです。
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 (デフォルト)、uWSGI: 0.9.8.2、nginx: 0.8.54