1

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 http://192.168.62.128/ and ab -n 100 -c 5 http://192.168.62.128:8000/

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

2
  • I'm having similar problems, did you ever solve this? Jan 27, 2011 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. Feb 27, 2011 at 7:41

1 Answer 1

0

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

1
  • 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, 2010 at 5:49

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .