Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I've been trying to figure why my Django Development Server is running 6-10x faster than mod_wsgi (which is supposed to be faster). I believe it must be restarting the Django process between requests, even though it shouldn't be until it hits it's MaxRequestsPerChild on a given process (correct me if I'm wrong).

So far I've tried: tweaking the daemon (processes=1/processes=2). Changing StartServers in apache2.conf (to 1, then back to 2 - no difference really). Switching to daemon mode (this improved things by a factor of 10 - apache was 100x slower before ;)

I'm running it in an Ubuntu VM.

Django Wsgi file: http://pastebin.com/qe1UG1iJ

My vhost configuration: http://pastebin.com/bqASHhD0

My apache configuration: http://pastebin.com/TfMGGvWc

I ran ab with ab -n 100 -c 5 and ab -n 100 -c 5

ab results for apache: http://pastebin.com/bu5YWbqJ

ab results for development server: http://pastebin.com/MdX9V55e

Sample top output while devserver is being benchmarked: http://pastebin.com/a7U0SL7B

Sample top output while apache is being benchmarked: http://pastebin.com/21zqRHPF

My apache log file is showing a lot of these: http://pastebin.com/PVd5z9BB

share|improve this question
I'm having similar problems, did you ever solve this? –  Derek Organ Jan 27 '11 at 12:38
Don't use embedded mode unless you configure Apache properly for persistent fat Python web application. See 'blog.dscpl.com.au/2009/03/…;. OP was probably seeing slow response because of Apache recycling/needing to start new processes when embedded mode used. –  Graham Dumpleton Feb 27 '11 at 7:41
add comment

1 Answer

Did you try uWsgi? → http://projects.unbit.it/uwsgi/

share|improve this answer
Thanks for the suggestion, I heard it mentioned in the Django channel as well. My though is that this might be more on Apache's end, though. Scouring the internet, everyone seems to be doing fairly well with mod_wsgi. –  bundini Oct 4 '10 at 5:49
add comment

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.