4 ms·
For django app hosting, I believe the usual good advice is to use something like uWSGI or Gunicorn to manage a load-balanced worker pool, and use nginx in front
by pjscott 16y ago
For django app hosting, I believe the usual good advice is to use something like uWSGI or Gunicorn to manage a load-balanced worker pool, and use nginx in front as a reverse proxy. There are a lot of subtle things that such a configuration does correctly out of the box. It looks like Gunicorn is really easy to set up, uWSGI has more features, and both are good, solid choices that lots of people are using in production:
http://gunicorn.org/ http://gunicorn.org/
http://projects.unbit.it/uwsgi/ http://projects.unbit.it/uwsgi/
If some parts of your application need to handle loads of concurrent connections (e.g. long polling, streaming, etc.) then you can use something like Tornado or eventlet or gevent to make that part of your app, and stick it behind nginx as well. You can also use the asynchronous worker types supported by Gunicorn and uWSGI. Which one is more straightforward is up to you.
As usual, you'll want to use something like Supervisord, Upstart, or Monit to monitor your daemons and restart them if they malfunction.
- mixmastamyk 16y agoThanks for the info. uwsgi was my second choice, gunicorn didn't seem to have as good performance, but if it is a lot easier I'll give it a try. To be honest, performance isn't a huge concern for my app, but I'm trying to fit it into a ec2 micro and therefore want to squeeze the most from it.