我面临一些奇怪的问题。当我为Django应用程序运行单个worker时?像这样:python manage.py run_gunicorn -w 1python manage.py runserver所有请求均正确满足,但如果启动多个工作程序,例如:python manage.py run_gunicorn -w 10Django对(大约)我的请求的一半做出错误回应:2013-06-13 18:02:39 [10205] [ERROR] Error handling requestTraceback (most recent call last): File "/home/mezhenin/venv/karma/local/lib/python2.7/site-packages/gunicorn/workers/sync.py", line 130, in handle_request for item in respiter: File "/home/mezhenin/venv/karma/local/lib/python2.7/site-packages/raven/middleware.py", line 27, in __call__ iterable = self.application(environ, start_response) File "/home/mezhenin/venv/karma/local/lib/python2.7/site-packages/django/core/handlers/wsgi.py", line 255, in __call__ response = self.get_response(request) File "/home/mezhenin/venv/karma/local/lib/python2.7/site-packages/django/core/handlers/base.py", line 177, in get_response signals.got_request_exception.send(sender=self.__class__, request=request) File "/home/mezhenin/venv/karma/local/lib/python2.7/site-packages/django/dispatch/dispatcher.py", line 170, in send response = receiver(signal=self, sender=sender, **named) File "/home/mezhenin/venv/karma/local/lib/python2.7/site-packages/django/db/__init__.py", line 68, in _rollback_on_exception transaction.rollback_unless_managed(using=conn) File "/home/mezhenin/venv/karma/local/lib/python2.7/site-packages/django/db/transaction.py", line 143, in rollback_unless_managed connection.rollback_unless_managed() File "/home/mezhenin/venv/karma/local/lib/python2.7/site-packages/django/db/backends/__init__.py", line 232, in rollback_unless_managed self._rollback() File "/home/mezhenin/venv/karma/local/lib/python2.7/site-packages/django/db/backends/__init__.py", line 59, in _rollback return self.connection.rollback()OperationalError: no connection to the server我尝试将sqlite3用作Django的数据库后端,并且工作正常。有人对psycopg2有相同的问题吗?Django==1.5gunicorn==0.17.2psycopg2==2.5
添加回答
举报
0/150
提交
取消