title: Why is my django/psql site so incredibly slow?
body: <p>I have a django site which has only an admin interface, since it's an internal thing.</p>
  
  <p>Simple pages load almost instantly, like say a table with 10 items.</p>
  
  <p>But a page with lots of inlines and so on will take 5-10 seconds to load, sometimes even longer. It's almost unusable.</p>
  
  <p>This is NOT a huge database by any means. I have a few dozen models and no table has more than 500 entries.</p>
  
  <p>Running Ubuntu 10.04 on a recent quad-core Xeon with 12 GB RAM.</p>
  
  <p>The problems occur with the production server (mod_wsgi) and with the development server too. Generally worse with the production server, but both are seriously slow.</p>
  
  <p>During the delay, one CPU core maxes out for apache (if I'm using the production server) or python (if I'm using the development server).</p>
  
  <p>I have tried playing around with WSGIDaemonProcess, changing the number of threads and processes, but to no avail.</p>
  
  <p>Below is my apache config file, but like I said I have problems with the dev server too so this may not really be an apache issue.</p>
  
  <p>Thanks for any help. Apologies for any improper use of terminology, etc. I am a C and MATLAB programmer and don't really know much about servers, networks, databases or python. Also, I do realize there are several threads on slow django responses, and I have read them all, but I haven't found anything that helps my situation. Thanks!</p>
  
  <pre><code>WSGIDaemonProcess MY_ACTUAL_IP_ADDRESS user=MY_USERNAME group=MY_USERNAME threads=4
  WSGIProcessGroup MY_ACTUAL_IP_ADDRESS
  
  WSGIScriptAlias /wsgi /neuroling/projects/neuroxy/neuroxy_project/neuroxy.wsgi
  &lt;Directory /neuroling/projects/neuroxy/neuroxy_project/&gt;
    Order allow,deny
    Allow from all
  &lt;/Directory&gt;
  
  Alias /media/ /var/www/media/
  Alias /static/ /var/www/static/
  
  &lt;Directory /var/www/static&gt;
  Order deny,allow
  Allow from all
  &lt;/Directory&gt;
  
  &lt;Directory /var/www/media&gt;
  Order deny,allow
  Allow from all
  &lt;/Directory&gt;
  </code></pre>