我面臨一些奇怪的問題。當我為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
提交
取消