Назад | Перейти на главную страницу

Supervisord и gunicorn_django иногда плохо работают

Я могу выполнить команду через supervisorctl, чтобы завершить мой процесс gunicorn_django, но иногда он зависает, пока мне не придется в конечном итоге убить его с помощью -9. Журнал процесса обычно имеет следующее:

2011-12-07 23:42:36 [27031] [INFO] Booting worker with pid: 27031
2011-12-07 23:42:37 [27033] [INFO] Booting worker with pid: 27033
2011-12-08 17:44:19 [26931] [INFO] Handling signal: term
2011-12-08 17:44:20 [26966] [INFO] Worker exiting (pid: 26966)
2011-12-08 17:44:20 [26993] [INFO] Worker exiting (pid: 26993)
2011-12-08 17:44:20 [26934] [INFO] Worker exiting (pid: 26934)
2011-12-08 17:44:20 [26937] [INFO] Worker exiting (pid: 26937)
2011-12-08 17:44:20 [26939] [INFO] Worker exiting (pid: 26939)
2011-12-08 17:44:20 [26936] [INFO] Worker exiting (pid: 26936)
2011-12-08 17:44:20 [26935] [INFO] Worker exiting (pid: 26935)
2011-12-08 17:44:20 [26998] [INFO] Worker exiting (pid: 26998)
Exception KeyError: KeyError(47572017784944,) in <module 'threading' from '/opt/python2.7/lib/python2.7/threading.pyc'> ignored
Exception KeyError: KeyError(47572017784944,) in <module 'threading' from '/opt/python2.7/lib/python2.7/threading.pyc'> ignored
Exception SystemExit: 0 in <module 'threading' from '/opt/python2.7/lib/python2.7/threading.pyc'> ignored
Exception KeyError: KeyError(47572017784944,) in <module 'threading' from '/opt/python2.7/lib/python2.7/threading.pyc'> ignored
Exception SystemExit: 0 in <module 'threading' from '/opt/python2.7/lib/python2.7/threading.pyc'> ignored
Exception SystemExit: 0 in <module 'threading' from '/opt/python2.7/lib/python2.7/threading.pyc'> ignored
Exception KeyError:  in <module 'threading' from '/opt/python2.7/lib/python2.7/threading.pyc'> ignored
Exception SystemExit:  in <module 'threading' from '/opt/python2.7/lib/python2.7/threading.pyc'> ignored
Exception Exception SystemExit: 0 in <module 'threading' from '/opt/python2.7/lib/python2.7/threading.pyc'> ignored
SystemExit: 0 in <module 'threading' from '/opt/python2.7/lib/python2.7/threading.pyc'> ignored
Exception SystemExit: 0 in <module 'threading' from '/opt/python2.7/lib/python2.7/threading.pyc'> ignored
Exception SystemExit: 0 in <module 'threading' from '/opt/python2.7/lib/python2.7/threading.pyc'> ignored
Exception SystemExit: 0 in <module 'threading' from '/opt/python2.7/lib/python2.7/threading.pyc'> ignored
Exception SystemExit: 0 in <module 'threading' from '/opt/python2.7/lib/python2.7/threading.pyc'> ignored
Exception SystemExit: 0 in <module 'threading' from '/opt/python2.7/lib/python2.7/threading.pyc'> ignored
Exception SystemExit: 0 in <module 'threading' from '/opt/python2.7/lib/python2.7/threading.pyc'> ignored
2011-12-08 17:44:31 [23023] [INFO] Starting gunicorn 0.13.4
2011-12-08 17:44:31 [23023] [ERROR] Connection in use: ('127.0.0.1', 8001)
2011-12-08 17:44:31 [23023] [ERROR] Retrying in 1 second.
2011-12-08 17:44:32 [23023] [ERROR] Connection in use: ('127.0.0.1', 8001)
2011-12-08 17:44:32 [23023] [ERROR] Retrying in 1 second.
2011-12-08 17:44:33 [23023] [ERROR] Connection in use: ('127.0.0.1', 8001)
2011-12-08 17:44:33 [23023] [ERROR] Retrying in 1 second.
2011-12-08 17:44:34 [23023] [ERROR] Connection in use: ('127.0.0.1', 8001)
2011-12-08 17:44:34 [23023] [ERROR] Retrying in 1 second.
2011-12-08 17:44:35 [23023] [ERROR] Connection in use: ('127.0.0.1', 8001)
2011-12-08 17:44:35 [23023] [ERROR] Retrying in 1 second.
2011-12-08 17:44:36 [23023] [ERROR] Can't connect to ('127.0.0.1', 8001)

Вот некоторая соответствующая конфигурация супервизора:

[program:gunicorn]
command=gunicorn_django --workers=20 --log-level info --timeout 500 --bind=127.0.0.1:8001
directory=/website/gunicorn-app
stdout_logfile=/var/log/gunicorn_log
stderr_logfile=/var/log/gunicorn_log
startsecs=10
autostart=true

я также не используя root, и приложение работает внутри virtualenv

Может ли кто-нибудь сказать мне, это проблема с питоном или с пулеметом?

Раньше были проблемы с gunicorn и supervisord, какая у вас версия gunicorn. Вы пробовали обновиться?