3

I am currently running a high-traffic python/django website using Apache and mod_wsgi. I'm hoping that there's a faster webserver configuration out there, and I've heard a fair number of recommendations for lighttpd and fastcgi. Is this setup faster than apache+mod_wsgi for serving dynamic django pages (I'm already convinced that lighttpd can server static files better)? The benchmarks online are either poorly conducted or inconclusive so I'm looking for some personal anecdotes. What architectural benefits does lighttpd + fastcgi provide? I understand that lighttpd uses epoll, and that a fastcgi process will be multithreaded. Also, having two separate processes, one for lighttpd and one for the python interpreter, will be largely beneficial.

I am aware of tornado and its ability to handle thousands of file descriptors with much fewer threads using epoll and callbacks. However, I'd prefer to stick with django for now.

Thanks,

Ken

1
  • You might want to consider nginx+fastcgi. It's fast and less buggy compared to lighttpd. Commented Sep 24, 2009 at 11:22

4 Answers 4

4

I suggest nginx with superfcgi for web sites with high load. nginx is very fast for static files. superfcgi uses multiple processes with multiple threads that shows high stability for python applications in spite of GIL, just set number of processes to number of CPU cores at your server.

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

Comments

1

I don't have thorough benchmarks, but I'm personally convinced that, just like lighttpd can outperform apache on simpler tasks, mod_wsgi gives apache the laurel when it comes to serving Python web apps. (nginx with its own mod_wsgi seems to perform even better than apache, but, hey, you didn't ask about that!-).

1 Comment

The nginx/mod_wsgi module also has potential issues as is the case where running any WSGI system direct on an event system in a multi process configuration. See 'blog.dscpl.com.au/2009/05/…'.
1

Doesn't answer you question, but do you already use caching for your site? Like memcached? This might give you a better performance gain than going through the mess of switching webservers.

Comments

0

you can try fcgid. https://github.com/chenyf/fcgid, it's a C++ fastcgi server

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.