Which is best for Django? Lighttpd or Nginx? Or maybe something else? [closed]
Which of Lighttpd and Nginx is, basing on your experience, better suited for Django? I've used both and can hardly notice any difference at all, they just work fine... Are there any use cases when one of them acts much better than the other? When answering please take in account both simplicity of configuration and efficiency.
My usual setup is to have a separate Django FCGI process (like in ./manage.py runfcgi daemonize=false port=8098 host=127.0.0.1
) launched via daemontools or an init.d
script and lighty/nginx acting as a reverse proxy.
Oh, and if you feel some other http server is much better for Django than Lighty and Nginx, please don't hesitate to share your thoughts.
Solution 1:
Both Nginx and Lighttpd are better choices than apache when it comes to using them as a reverse proxy for Django, Rails, etc. Both support FastCGI and Http proxying. Both offer a single threaded select() (or better) based model for efficient resource usage.
However my vote goes to Nginx, it's got a very active user base (it's currently the darling of the Ruby on Rails set), and is under active development. Lighttpd could be mistaken for being dead, 2+ years and we're still waiting on a beta of 1.5.
Solution 2:
mod_wsgi is recommended way to get Django application into production. Apache's mod_wsgi is much better than nginx. You can't find official package (in current Linux distributions) for nginx's mod_wsgi and You need to compile it by yourself. I like nginx but if You want to play safe, play with Apache mod_wsgi.
Solution 3:
mod-wsgi is the best way to run django apps in production, less fiddly than fastcgi and no issues with start up times etc.
The real mod-wsgi is for apache, but there is another mod-wsgi for nginx. The apache one is brilliant, I can't comment on the nginx one.
Personally, I'd stay away from lighttpd. It doesn't have the stability of nginx, I've not yet seen a case of lighttpd that doesn't have a memory leak.
Basically, my first choice would be apache 2.2, my second choice would be nginx.
Don't believe the hype about response time and scalability. Truth is, it just doesn't matter. (Google use Apache).
Solution 4:
Also, consider using Google App Engine. You can host your Django project there for free and not have to worry about maintaining the server infrastructure.