Using Django (hosted by Webfaction), I have the following code
import time
def my_function(request):
time.sleep(10)
return HttpResponse("Done")
This is done through Django when I go to my url, www.mysite.com
I entered the URL twice, right after each other. As I see it, both of them should end in 10 seconds. However, the second call waits for the first and ends after 20 seconds.
If, however, I enter some dummy GET parameter, www.mysite.com?dummy=1 and www.mysite.com?dummy=2, then they both finish in 10 seconds. Thus, both of them can work simultaneously.
As if the sphere of sleep () is somehow global? Perhaps the input of the parameter leads to the fact that they start as different processes, and not the same ones ???
It is hosted by Webfaction. httpd.conf has:
KeepAlive Off
Listen 30961
MaxSpareThreads 3
MinSpareThreads 1
ServerLimit 1
SetEnvIf X-Forwarded-SSL on HTTPS=1
ThreadsPerChild 5
sleep() , . , ?
: Webfaction Apache.