You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Filipe <fm...@gmail.com> on 2007/04/11 18:42:27 UTC

mod_proxy buffering small chunks

I'm trying to use apache to proxy a push application, using chunked transfer
encoding. The problem is that the mod_proxy buffers the server response
internally and only sends the data to the client when the buffer is filled
or the connection with the server is terminated.

This behavior is not adequate for push applications, where the response must
be redirected instantly to the http client.

This problem was discussed a year ago:
http://mail-archives.apache.org/mod_mbox/httpd-dev/200602.mbox/raw/%3C20060213204845.GA29907@maribor.izzy.net%3E/



Anyone knows if this problem has been resolved?

Filipe Figueiredo - fmfig82@gmail.com

Re: mod_proxy buffering small chunks

Posted by Jim Jagielski <ji...@jaguNET.com>.
On Apr 13, 2007, at 12:03 PM, Mladen Turk wrote:

> Jim Jagielski wrote:
>>>
>>> Not according to my tests. The simple server push still
>>> buffers the data.
>>>
>> Hmmm a followup commit has:
>>   URL: http://svn.apache.org/viewvc?view=rev&rev=504559
>> so that may be exactly the case...
>
> Huh, looks like it works now. Although I didn't test is with
> mod_deflate, but I suppose it should work as well.
>
> Can we get those back trough 2.0?
>

Def for 2.2 (maybe you were testing 2.2 and not
trunk??)... I'll see how much can actually
go to 2.0 :)


Re: mod_proxy buffering small chunks

Posted by Mladen Turk <mt...@apache.org>.
Jim Jagielski wrote:
> 
>>
>> Not according to my tests. The simple server push still
>> buffers the data.
>>
> 
> Hmmm a followup commit has:
> 
>   URL: http://svn.apache.org/viewvc?view=rev&rev=504559
> 
> so that may be exactly the case...
> 
> 

Huh, looks like it works now. Although I didn't test is with
mod_deflate, but I suppose it should work as well.

Can we get those back trough 2.0?

Regards,
Mladen.

Re: mod_proxy buffering small chunks

Posted by Jim Jagielski <ji...@jaguNET.com>.
On Apr 13, 2007, at 11:34 AM, Jim Jagielski wrote:

>
> On Apr 13, 2007, at 5:20 AM, Mladen Turk wrote:
>
>> Plüm wrote:
>>> +1 I will try to check it once you have proposed it and give it
>>> a quick vote.
>>>> I have another one that fixes this issues for non-chunked content.
>>> I haven't tried yet, but IMHO it should already work for non-chunked
>>> content. Is this not the case?
>>>
>>
>> Not according to my tests. The simple server push still
>> buffers the data.
>>
>
> Hmmm a followup commit has:
>
>   URL: http://svn.apache.org/viewvc?view=rev&rev=504559
>   Log:
>   Further refinement for PR41056 / PR 19954 (mostly-fixed in r480135.)
>   We assume that a successful read but an empty brigade
>   is NOT cause for EAGAIN. Testing may or may not
>   confirm this assumption, in which case that test
>   may be required as well.
>
> so that may be exactly the case...
>

I refer people to

   http://mail-archives.apache.org/mod_mbox/httpd-dev/200702.mbox/% 
3c45C8E004.9040707@apache.org%3e

... so maybe a successful read of an empty line in AP_MODE_GET_LINE
does *not* return an empty brigade... We currently assuming
it does.

Anyone able to test if Rüdiger's version addresses this?


Re: mod_proxy buffering small chunks

Posted by Jim Jagielski <ji...@jaguNET.com>.
On Apr 13, 2007, at 5:20 AM, Mladen Turk wrote:

> Plüm wrote:
>> +1 I will try to check it once you have proposed it and give it
>> a quick vote.
>>> I have another one that fixes this issues for non-chunked content.
>> I haven't tried yet, but IMHO it should already work for non-chunked
>> content. Is this not the case?
>>
>
> Not according to my tests. The simple server push still
> buffers the data.
>

Hmmm a followup commit has:

   URL: http://svn.apache.org/viewvc?view=rev&rev=504559
   Log:
   Further refinement for PR41056 / PR 19954 (mostly-fixed in r480135.)
   We assume that a successful read but an empty brigade
   is NOT cause for EAGAIN. Testing may or may not
   confirm this assumption, in which case that test
   may be required as well.

so that may be exactly the case...

Re: mod_proxy buffering small chunks

Posted by Jim Jagielski <ji...@jaguNET.com>.
On Apr 13, 2007, at 5:20 AM, Mladen Turk wrote:

>
> Anyhow, I'll commit a patch to the trunk for http, cause its
> configurable by flushwait and skipped otherwise.
>

Looking forward to seeing it... recall that if we flush at
every "chunk" with HTTP, we will be dead slow and filters
will not be happy :)


Re: mod_proxy buffering small chunks

Posted by Mladen Turk <mt...@apache.org>.
Plüm wrote:
> 
> 
> +1 I will try to check it once you have proposed it and give it
> a quick vote.
> 
>> I have another one that fixes this issues for non-chunked content.
> 
> I haven't tried yet, but IMHO it should already work for non-chunked
> content. Is this not the case?
>

Not according to my tests. The simple server push still
buffers the data.

>> I've tested this and a flushwait=timeout can work very well with
>> mod_proxy_http. The principle is the same as Rudiger did for ajp.
> 
> Although I introduced the flushwait solution for ajp (which is partly
> obsolete with later Tomcats thanks to your patch which takes empty
> ajp chunk messages as a flushing request) and still think it is a good idea
> I like the approach of mod_proxy_http even more as it works without further
> configuration and is even smarter.
>

flushwait still works with older Tomcat versions that do not send
a separate 'explicit flush' packet, and IMHO that is the only solution
for http. I'm not speaking here about Tomcat, but a generic standalone
backends and http/1.0 clients that have problems with chunked encodings.

Anyhow, I'll commit a patch to the trunk for http, cause its
configurable by flushwait and skipped otherwise.

Regards,
Mladen.

Re: mod_proxy buffering small chunks

Posted by Plüm, Rüdiger, VF-Group <ru...@vodafone.com>.

> -----Ursprüngliche Nachricht-----
> Von: Mladen Turk 
> Gesendet: Freitag, 13. April 2007 07:07
> An: dev@httpd.apache.org
> Betreff: Re: mod_proxy buffering small chunks
> 
> 
> Jim Jagielski wrote:
> > 
> >>
> >> This is only fixed in trunk so far. See
> >> http://issues.apache.org/bugzilla/show_bug.cgi?id=41056
> >> and
> >> http://svn.apache.org/viewvc?view=rev&revision=480135
> >>
> > 
> > Hmmm. Looks like a backport candidate... I'll likely
> > do some testing and propose if it works :)

+1 I will try to check it once you have proposed it and give it
a quick vote.

> > 
> 
> I have another one that fixes this issues for non-chunked content.

I haven't tried yet, but IMHO it should already work for non-chunked
content. Is this not the case?

> 
> I've tested this and a flushwait=timeout can work very well with
> mod_proxy_http. The principle is the same as Rudiger did for ajp.

Although I introduced the flushwait solution for ajp (which is partly
obsolete with later Tomcats thanks to your patch which takes empty
ajp chunk messages as a flushing request) and still think it is a good idea
I like the approach of mod_proxy_http even more as it works without further
configuration and is even smarter.

Regards

Rüdiger


Re: mod_proxy buffering small chunks

Posted by Mladen Turk <mt...@apache.org>.
Jim Jagielski wrote:
> 
>>
>> This is only fixed in trunk so far. See
>> http://issues.apache.org/bugzilla/show_bug.cgi?id=41056
>> and
>> http://svn.apache.org/viewvc?view=rev&revision=480135
>>
> 
> Hmmm. Looks like a backport candidate... I'll likely
> do some testing and propose if it works :)
> 

I have another one that fixes this issues for non-chunked content.

I've tested this and a flushwait=timeout can work very well with
mod_proxy_http. The principle is the same as Rudiger did for ajp.

Regards,
Mladen.

Re: mod_proxy buffering small chunks

Posted by Jim Jagielski <ji...@jaguNET.com>.
On Apr 11, 2007, at 3:34 PM, Ruediger Pluem wrote:

>
>
> On 04/11/2007 06:42 PM, Filipe wrote:
>> I'm trying to use apache to proxy a push application, using chunked
>> transfer
>> encoding. The problem is that the mod_proxy buffers the server  
>> response
>> internally and only sends the data to the client when the buffer  
>> is filled
>> or the connection with the server is terminated.
>>
>> This behavior is not adequate for push applications, where the  
>> response
>> must
>> be redirected instantly to the http client.
>>
>> This problem was discussed a year ago:
>> http://mail-archives.apache.org/mod_mbox/httpd-dev/200602.mbox/raw/ 
>> %3C20060213204845.GA29907@maribor.izzy.net%3E/
>
> This is only fixed in trunk so far. See
> http://issues.apache.org/bugzilla/show_bug.cgi?id=41056
> and
> http://svn.apache.org/viewvc?view=rev&revision=480135
>

Hmmm. Looks like a backport candidate... I'll likely
do some testing and propose if it works :)


Re: mod_proxy buffering small chunks

Posted by Ruediger Pluem <rp...@apache.org>.

On 04/11/2007 06:42 PM, Filipe wrote:
> I'm trying to use apache to proxy a push application, using chunked
> transfer
> encoding. The problem is that the mod_proxy buffers the server response
> internally and only sends the data to the client when the buffer is filled
> or the connection with the server is terminated.
> 
> This behavior is not adequate for push applications, where the response
> must
> be redirected instantly to the http client.
> 
> This problem was discussed a year ago:
> http://mail-archives.apache.org/mod_mbox/httpd-dev/200602.mbox/raw/%3C20060213204845.GA29907@maribor.izzy.net%3E/

This is only fixed in trunk so far. See
http://issues.apache.org/bugzilla/show_bug.cgi?id=41056
and
http://svn.apache.org/viewvc?view=rev&revision=480135

Regards

Rüdiger