On 1-jul-2007, at 21:24, Dirk van Oosterbosch, IR labs wrote:
>
> I narrowed down the moment the extra processes are spawned by  
> FastCGI to be here:
>
>       if request.method == 'POST':
>               if not (('poster' in request.FILES) or ('movie' in 
> request.FILES)):

The following happens upon receivement of large POST's:
FastCGI starts up the (Django) site script which passes the request  
to the view code. Then the script gets untill between the two excerpt  
lines above. But because it is a large POST and is not completely  
received over the wire yet, it hangs / waits (whatever you wanna call  
it) there. This makes FastCGI think that the whole handling of the  
request is stalled, upon which FastCGI spawns a new process every 3  
seconds (ultimately crashing the server).

If found this old thread on the FastCGI list, which seems to  
accurately explains the problem:
http://www.fastcgi.com/archives/fastcgi-developers/2004-January/ 
003206.html

However, the proposed solution, to put this on the top of the view code:
        tmp_response = HttpResponse()
        tmp_response.write("Content-type: text/html")
        tmp_response.flush()

does not seem to work.
Is text/html the correct Content-type to use with Django?

I would be very surprised if uploading files using Django and FastCGI  
does work for anyone at all, with the present code.
Is nobody having troubles with large POST's?


Two more questions:
2. I'm trying to debug this uploading script using print statements  
code. These print statement however show up in Apache's error.log  
quite late, much later than the warnings and notifications of  
FastCGI. Is there a way to flush these print statements so I can find  
them in the error.log sooner?

3. What is the exact behavior when a request containing a POST comes  
in? Shouldn't it be buffering the data while the data comes in and be  
telling FastCGI it is handling the request? What is exactly happening  
between those two lines in my code above?


Best regards,
dirk




--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to