I have setup a Linux server with Apache and mod_wsgi. From my Apache configuration:
WSGIDaemonProcess myapp processes=1 threads=10
Here myapp is a Django webapp. When myapp receives a large http POST request from Apache in a Django HttpRequest object, accessing the posted data the fist time takes several seconds of wallclock time. I assume this is because myapp is invoked before the full body of the POST is read from the network and that accessing the posted data in the HttpRequest object blocks until the posted data is read.
Is there a way to not have myapp invoked until Apache has read all the posted data?
I ask because I want to tune the number of threads (in this case 10) to what is most optimal for concurrent processing in myapp. Therefore, I do not want to spend time in these requests on just waiting on receiving posted data from the network.
I am aware that I could potentially increase the number of threads to more than 10 and implement another mechanism to ensure that at most 10 threads are processing concurrently.