Mailing List Archive

File upload stalls: Django + FastCGI + threaded mode
I've sent a message to the list before about this problem, but I wasn't able to pinpoint the cause. Now I believe I got it.

I have a Django app served with FastCGI to Cherokee, using threaded mode in order to avoid some database issues. My daemon line is like this:

python /storage/test/colibri/manage.py runfcgi protocol=fcgi socket=/tmp/test-fcgi.sock pidfile=/tmp/test-fcgi.pid method=threaded debug=true

I have keep-alive and chunked encoding disabled. If I request a form page with an upload input, and right after I try to upload a file (any file, doesn't matter the file size), it works fine. But, if I request the form page, have the browser sit idle for sometime, and after that I try to initiate the upload, Cherokee stalls on file uploading.

This happens regardless of my keep-alive configuration, but always happens if I'm using threaded mode. With prefork, I don't see the issue.

Now, I don't believe this bug is related to Django itself, neither I should have this strange behaviour with threaded mode. I'm considering it's something wrong on Cherokee, because the behaviour looks like a keep-alive problem.

Unfortunately, I'm unable to debug more than this. I request if someone can please take a look at this issue and try to reproduce it with a Django app (1.1) deployed the same way as me + Cherokee 0.99.44. Running Django with prefork got it's share of problems already, so it's preferred to use it in threaded mode. Now I can't use either, because either I got database problems, or I got those Cherokee file upload problems.

Thanks!
_______________________________________________
Cherokee mailing list
Cherokee@lists.octality.com
http://lists.octality.com/listinfo/cherokee
Re: File upload stalls: Django + FastCGI + threaded mode [ In reply to ]
Sorry: in fact, this also happens with prefork mode too.

The only consistent way I can reproduce this problem, is waiting before initiating the upload. Looks like something wrong on Cherokee or the way I'm configuring it.

I look at the HTTP requests and they look fine. When the problem happens, I see it only transferred the first few bytes, and then stalls. Tested on Firefox, Safari and Chrome.

I'm completely lost and have no idea how to debug any further. I really need some help on this one, or my only solution is going back to Apache.

Thanks again!

Em 09/04/2010, às 19:23, Henrique Carvalho Alves escreveu:

> I've sent a message to the list before about this problem, but I wasn't able to pinpoint the cause. Now I believe I got it.
>
> I have a Django app served with FastCGI to Cherokee, using threaded mode in order to avoid some database issues. My daemon line is like this:
>
> python /storage/test/colibri/manage.py runfcgi protocol=fcgi socket=/tmp/test-fcgi.sock pidfile=/tmp/test-fcgi.pid method=threaded debug=true
>
> I have keep-alive and chunked encoding disabled. If I request a form page with an upload input, and right after I try to upload a file (any file, doesn't matter the file size), it works fine. But, if I request the form page, have the browser sit idle for sometime, and after that I try to initiate the upload, Cherokee stalls on file uploading.
>
> This happens regardless of my keep-alive configuration, but always happens if I'm using threaded mode. With prefork, I don't see the issue.
>
> Now, I don't believe this bug is related to Django itself, neither I should have this strange behaviour with threaded mode. I'm considering it's something wrong on Cherokee, because the behaviour looks like a keep-alive problem.
>
> Unfortunately, I'm unable to debug more than this. I request if someone can please take a look at this issue and try to reproduce it with a Django app (1.1) deployed the same way as me + Cherokee 0.99.44. Running Django with prefork got it's share of problems already, so it's preferred to use it in threaded mode. Now I can't use either, because either I got database problems, or I got those Cherokee file upload problems.
>
> Thanks!

_______________________________________________
Cherokee mailing list
Cherokee@lists.octality.com
http://lists.octality.com/listinfo/cherokee
Re: File upload stalls: Django + FastCGI + threaded mode [ In reply to ]
On 10/04/2010, at 00:42, Henrique Carvalho Alves wrote:

> Sorry: in fact, this also happens with prefork mode too.
>
> The only consistent way I can reproduce this problem, is waiting before initiating the upload. Looks like something wrong on Cherokee or the way I'm configuring it.
>
> I look at the HTTP requests and they look fine. When the problem happens, I see it only transferred the first few bytes, and then stalls. Tested on Firefox, Safari and Chrome.

Could you please provide us a small script to reproduce the issue. I'd most likely spend much more time messing around with Django than debugging the problem itself. It'd be perfect if you could attach it to a bug report.

> I'm completely lost and have no idea how to debug any further. I really need some help on this one, or my only solution is going back to Apache.

This sort of 'threatening observations' do not help.

> Thanks again!

Thank _you_ for reporting the possible bug.
Cheers!

> Em 09/04/2010, às 19:23, Henrique Carvalho Alves escreveu:
>
>> I've sent a message to the list before about this problem, but I wasn't able to pinpoint the cause. Now I believe I got it.
>>
>> I have a Django app served with FastCGI to Cherokee, using threaded mode in order to avoid some database issues. My daemon line is like this:
>>
>> python /storage/test/colibri/manage.py runfcgi protocol=fcgi socket=/tmp/test-fcgi.sock pidfile=/tmp/test-fcgi.pid method=threaded debug=true
>>
>> I have keep-alive and chunked encoding disabled. If I request a form page with an upload input, and right after I try to upload a file (any file, doesn't matter the file size), it works fine. But, if I request the form page, have the browser sit idle for sometime, and after that I try to initiate the upload, Cherokee stalls on file uploading.
>>
>> This happens regardless of my keep-alive configuration, but always happens if I'm using threaded mode. With prefork, I don't see the issue.
>>
>> Now, I don't believe this bug is related to Django itself, neither I should have this strange behaviour with threaded mode. I'm considering it's something wrong on Cherokee, because the behaviour looks like a keep-alive problem.
>>
>> Unfortunately, I'm unable to debug more than this. I request if someone can please take a look at this issue and try to reproduce it with a Django app (1.1) deployed the same way as me + Cherokee 0.99.44. Running Django with prefork got it's share of problems already, so it's preferred to use it in threaded mode. Now I can't use either, because either I got database problems, or I got those Cherokee file upload problems.
>>
>> Thanks!
>
> _______________________________________________
> Cherokee mailing list
> Cherokee@lists.octality.com
> http://lists.octality.com/listinfo/cherokee

--
Octality
http://www.octality.com/

_______________________________________________
Cherokee mailing list
Cherokee@lists.octality.com
http://lists.octality.com/listinfo/cherokee
Re: File upload stalls: Django + FastCGI + threaded mode [ In reply to ]
Henrique Carvalho Alves <hcarvalhoalves <at> gmail.com> writes:

>
> Sorry: in fact, this also happens with prefork mode too.
<a href="http://www.inweddingdress.com" target="_top">www.inweddingdress.com</a>
>
> The only consistent way I can reproduce this problem, is waiting before
initiating the upload. Looks like
> something wrong on Cherokee or the way I'm configuring it.
>
> I look at the HTTP requests and they look fine. When the problem happens, I
see it only transferred the first
> few bytes, and then stalls. Tested on Firefox, Safari and Chrome.
>
> I'm completely lost and have no idea how to debug any further. I really need
some help on this one, or my only
> solution is going back to Apache.
>
> Thanks again!
>

_______________________________________________
Cherokee mailing list
Cherokee@lists.octality.com
http://lists.octality.com/listinfo/cherokee