You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Klaus Ebbe Grue <gr...@diku.dk> on 2005/09/26 21:25:17 UTC

[users@httpd] How to disable buffering in an Apache proxy server?

Hi,

Can you help with a hint for this scenario:

* If Apache is used as an http reverse proxy,
* if it relays a response from a backend server to a client,
* if the response is in HTTP/1.1 chunked transfer encoding,
* and if the response consists of many small chunks,
* then the proxy buffers the small chunks and pass them on in big chunks.

How can one instruct Apache to pass chunks on without delay and buffering
and rechunking?

Cheers,
Klaus

---

Background:

The question might be related to Bug #18157 for Apache httpd-1.3: Proxy
Buffering Disrupts Staged Response Delivery. That bug report says that
Apache httpd-1.3 ignores ProxyIOBufferSize values less than 8192 bytes.
But I use Apache 2.0.

The question is unrelated to FAQ F.4.: How can I get my script's output
without Apache buffering it?

In the scenario, not only the proxy but also the backend server is an 
Apache server. The small chunks from the backend server comprise
progress information from a slow CGI program which is invoked by the 
backend server. Each chunk should appear immediately in the users browser 
to tell the user that the CGI program still runs.

When accessing the backend server directly (without a proxy in between), the 
backend server sends the small chunks one at a time, and they are displayed 
fine one at a time in Mozilla.

Using tcpdump confirms that the backend sends small chunks to the proxy and 
that the proxy passes the stream on in big chunks.

The lines
   SetEnv downgrade-1.0
   SetEnv force-response-1.0
makes communication happen in HTTP/1.0, but the proxy still buffers the
input from the backend server.

The line
   ProxyIOBufferSize 10
has no effect.

For the proxy I have tried
   Server version: Apache/2.0.54
   Server built:   Jul 17 2005 12:28:44
and
   Server version: Apache/2.0.40
   Server built:   Sep  4 2002 17:20:34
For the backend server I use
   Server version: Apache/2.0.49
   Server built:   May  6 2004 07:15:13

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] How to disable buffering in an Apache proxy server?

Posted by Joe Orton <jo...@redhat.com>.
On Mon, Sep 26, 2005 at 09:25:17PM +0200, Klaus Ebbe Grue wrote:
> Hi,
> 
> Can you help with a hint for this scenario:
> 
> * If Apache is used as an http reverse proxy,
> * if it relays a response from a backend server to a client,
> * if the response is in HTTP/1.1 chunked transfer encoding,
> * and if the response consists of many small chunks,
> * then the proxy buffers the small chunks and pass them on in big chunks.
> 
> How can one instruct Apache to pass chunks on without delay and buffering
> and rechunking?

httpd 2.1.x releases should flush buffered content to the client 
whenever the backend server stalls - so if you try the 2.1.7 beta it 
should behave as you expect; please file bugs if not.

Regards,

joe


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org