Supervisord 和 gunicorn_django 有时不能很好地运行

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 并且应用程序正在运行虚拟环境

有人能告诉我这是 python 问题还是 gunicorn 问题吗?

答案1

gunicorn 和 supervisord 之前存在问题,你运行的是哪个版本的 gunicorn。你尝试过升级吗?

相关内容