[Fixed]-Gunicorn, nginx (v 1.3.14), django, and gevent-socket.io, on dotcloud


I asked 5 related questions above, and I’ll try to answer the first 3 here. (I don’t know enough of dotcloud underpinning to answer the last two). I also expect most folks finding this questions are focused mostly on websockets with gunicorn and nginx (and less on dotcloud particulars). For those folks, you can jump to a reference setup here: gunicorn deployment scheme with nginx

  1. Am I trying to solve a non-problem?

    a. I’ve done a fair amount of reading where it’s advised to put
    gunicorn behind nginx. In the context of dotcloud’s load balancers on
    the front line, is this still true?

    b. If I don’t expect that I’ll be subject to a DoS attack, is it still
    important to put gunicorn behind nginx?

From Ken Cochrane’s comment above, I believe the the dotcloud infrastructure itself provides the safety that nginx would normally provide in a DIY setup. Therefore, in this special case this was indeed a “non-problem.” However, in general, you do want gunicorn behind nginx, and you can definitely run websockets with that setup.

  1. Is it possible to run websockets through a unix socket as I have attempted to setup?

Yes. Here is a good reference on gunicorn deployment scheme with nginx. For websockets, be sure to read that whole section and include proxy_buffering off;

  1. Will the unix sockets break scaling on dotcloud?

My understanding is that sockets and ports should both work equally well.


Leave a comment