0

I have some Django sites running on a Nginx-Gunicorn server. But at some point I am getting Broken Pipe errors as below

Traceback (most recent call last):
File "/usr/lib/python2.7/SocketServer.py", line 582, in process_request_thread
self.finish_request(request, client_address)
File "/usr/lib/python2.7/SocketServer.py", line 323, in finish_request
self.RequestHandlerClass(request, client_address, self)
File "/root/djangoapps/env/mmiradio/local/lib/python2.7/site-packages/django/core/servers/basehttp.py", line 143, in _init_
super(WSGIRequestHandler, self).__init__(*args, **kwargs)
File "/usr/lib/python2.7/SocketServer.py", line 640, in _init_
self.finish()
 File "/usr/lib/python2.7/SocketServer.py", line 693, in finish
self.wfile.flush()
File "/usr/lib/python2.7/socket.py", line 303, in flush
 self._sock.sendall(view[write_offset:write_offset+buffer_size])

error: [Errno 32] Broken pipe

I have 'python manage.py runserver' in my gunicorn config for each site, so doubts whether that causes the problem ? As official Django says NEVER use it on production server.

3
  • 1
    if you have nginx and gunicorn set up why using runserver on top of that ? Commented Dec 23, 2014 at 12:57
  • I had just used a gunicorn_config.py file which can be run like /path-to-env/python /path-to-env/bin/gunicorn -c /path-to-project/gunicorn_config.py project.wsgi in nginx terminal , Is that causing this error and makes site horribly slow ? Commented Dec 23, 2014 at 13:03
  • frankly i have no idea, i never actually explicitly used anything .wsgi, but using gunicorn+nginx AND runserver definitely doesn't sound good Commented Dec 23, 2014 at 13:12

1 Answer 1

0

You are running two servers. See here:

https://docs.djangoproject.com/en/dev/ref/django-admin/#runserver-port-or-address-port

The runserver command is just a convenient little server for use in development.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.