title: Django, sleep() pauses all processes, but only if no GET parameter?
body: <p>Using Django (hosted by Webfaction), I have the following code </p>
  
  <pre><code>import time
  def my_function(request):
      time.sleep(10)
      return HttpResponse("Done")
  </code></pre>
  
  <p>This is executed via Django when I go to my url, www.mysite.com</p>
  
  <p>I enter the url twice, immediately after each other. The way I see it, both of these should finish after 10 seconds. However, the second call waits for the first one and finishes after 20 seconds. </p>
  
  <p>If, however, I enter some dummy GET parameter, www.mysite.com?dummy=1 and www.mysite.com?dummy=2 then they both finish after 10 seconds. So it is possible for both of them to run simultaneously. </p>
  
  <p>It's as though the scope of sleep() is somehow global?? Maybe entering a parameter makes them run as different processes instead of the same??? </p>
  
  <p>It is hosted by Webfaction. httpd.conf has:</p>
  
  <pre><code>KeepAlive Off
  Listen 30961
  MaxSpareThreads 3
  MinSpareThreads 1
  ServerLimit 1
  SetEnvIf X-Forwarded-SSL on HTTPS=1
  ThreadsPerChild 5
  </code></pre>
  
  <p>I do need to be able to use sleep() and trust that it isn't stopping everything. So, what's up and how to fix it? </p>
  
  <p>Edit: Webfaction runs this using Apache.</p>