【发布时间】:2015-11-12 04:55:40
【问题描述】:
在 Python3 上,我不能将 gevent 用作 wsgi。
有什么方法可以在 Python3 上运行像 gevent 这样的异步 wsgi。
我使用 wsgi 作为 gunicorn 并在 CentOS 6.6 上运行。
当我用 gunicorn 尝试 gevent 1.1b3 时,我得到了这些错误。
$ python manage.py gunicorn -k gevent
[2015-08-19 14:20:48 +0900] [13636] [INFO] Starting gunicorn 19.3.0
[2015-08-19 14:20:48 +0900] [13636] [INFO] Listening at: http://127.0.0.1:8000 (13636)
[2015-08-19 14:20:48 +0900] [13636] [INFO] Using worker: gevent
[2015-08-19 14:20:48 +0900] [13640] [INFO] Booting worker with pid: 13640
[2015-08-19 14:20:48 +0900] [13640] [ERROR] Exception in worker process:
Traceback (most recent call last):
File "/home/vagrant/.pyenv/versions/3.4.3/lib/python3.4/site-packages/gunicorn/arbiter.py", line 507, in spawn_worker
worker.init_process()
File "/home/vagrant/.pyenv/versions/3.4.3/lib/python3.4/site-packages/gunicorn/workers/ggevent.py", line 185, in init_process
self.patch()
File "/home/vagrant/.pyenv/versions/3.4.3/lib/python3.4/site-packages/gunicorn/workers/ggevent.py", line 74, in patch
_sock=s))
TypeError: __init__() got an unexpected keyword argument '_sock'
Traceback (most recent call last):
File "/home/vagrant/.pyenv/versions/3.4.3/lib/python3.4/site-packages/gunicorn/arbiter.py", line 507, in spawn_worker
worker.init_process()
File "/home/vagrant/.pyenv/versions/3.4.3/lib/python3.4/site-packages/gunicorn/workers/ggevent.py", line 185, in init_process
self.patch()
File "/home/vagrant/.pyenv/versions/3.4.3/lib/python3.4/site-packages/gunicorn/workers/ggevent.py", line 74, in patch
_sock=s))
TypeError: __init__() got an unexpected keyword argument '_sock'
[2015-08-19 14:20:48 +0900] [13640] [INFO] Worker exiting (pid: 13640)
[2015-08-19 14:20:48 +0900] [13636] [INFO] Shutting down: Master
[2015-08-19 14:20:48 +0900] [13636] [INFO] Reason: Worker failed to boot.
【问题讨论】:
标签: python wsgi uwsgi gunicorn gevent