You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Lucas Brasilino <lu...@gmail.com> on 2007/01/22 20:29:10 UTC

setting request timeout in mod_proxy/mod_proxy_balancer

Hi All:

As I point out in:

http://mail-archives.apache.org/mod_mbox/httpd-users/200701.mbox/raw/%3c45AFBE56.8080508@gmail.com%3e

I'm trying to set a request timeout. Sniffing around de source,
I saw that ap_proxy_http_process_response() (mod_proxy_http.c)
calls ap_getline() where is blocking, I think. Getting
deeper I think that "apr_bucket_read" macro is beeing 'called'
in a blocking fashion (APR_BLOCK_READ).
I'm not aware about Apache API, buckets, brigades and so on but
I'd like to know if it's so dificult to implement this call as
nonblocking and setting a timeout.
If the answer is 'no', anybody can show me a way to implement this
feature, so I can study Apache API and try to get the job done.

bests regards
Lucas Brasilino


Re: setting request timeout in mod_proxy/mod_proxy_balancer

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

> -----Ursprüngliche Nachricht-----
> Von: Lucas Brasilino 
> Gesendet: Dienstag, 23. Januar 2007 14:43
> An: dev@httpd.apache.org
> Betreff: Re: setting request timeout in mod_proxy/mod_proxy_balancer

> 
> > Based on your configuration from above, the following should work:
> 
> No, it doesn't. I've tried yet.

It should.

> From docs:
> 'Connection timeout in seconds. If not set the Apache
> will wait until the free connection is available. This
> directive is used for limiting the number of connections
> to the backend server together with max  parameter.'

The documentation is misleading and probably wrong, but
the code speaks a clear language.

> 
> My understanding is that this options set the
> TCP connection (SYN -> SYN+ACK -> ACK) timeout,
> not the HTTP response timeout.

It is used for the response timeout.

Regards

Rüdiger


Re: setting request timeout in mod_proxy/mod_proxy_balancer

Posted by Lucas Brasilino <lu...@gmail.com>.
Hi

> Based on your configuration from above, the following should work:

No, it doesn't. I've tried yet.
>From docs:
'Connection timeout in seconds. If not set the Apache
will wait until the free connection is available. This
directive is used for limiting the number of connections
to the backend server together with max  parameter.'

My understanding is that this options set the
TCP connection (SYN -> SYN+ACK -> ACK) timeout,
not the HTTP response timeout.


regards
Lucas Brasilino
> 
> ProxyRequests Off
> <Proxy balancer://webcluster>
>         BalancerMember http://server:9080 loadfactor=1 timeout=5
>         BalancerMember http://localhost:9080 loadfactor=1 timeout=5
>         ProxySet lbmethod=byrequests
> </Proxy>
> ProxyPass /loadbalancer balancer://webcluster/
> ProxyPassReverse /loadbalancer balancer://webcluster/
> ProxyHTMLLogVerbose On
> LogLevel Debug
> 
> Should set the timeout to 5 seconds. Take into account that this also means that the connection
> will be closed if your backend takes more than 5 seconds to generate a response or if there are
> pauses by the backend during sending the response that last more than 5 seconds.
> 
> 
> Regards
> 
> Rüdiger
> 
> 
> 


Re: setting request timeout in mod_proxy/mod_proxy_balancer

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

On 01/22/2007 08:29 PM, Lucas Brasilino wrote:
> Hi All:
> 
> As I point out in:
> 
> http://mail-archives.apache.org/mod_mbox/httpd-users/200701.mbox/raw/%3c45AFBE56.8080508@gmail.com%3e

Based on your configuration from above, the following should work:


ProxyRequests Off
<Proxy balancer://webcluster>
        BalancerMember http://server:9080 loadfactor=1 timeout=5
        BalancerMember http://localhost:9080 loadfactor=1 timeout=5
        ProxySet lbmethod=byrequests
</Proxy>
ProxyPass /loadbalancer balancer://webcluster/
ProxyPassReverse /loadbalancer balancer://webcluster/
ProxyHTMLLogVerbose On
LogLevel Debug

Should set the timeout to 5 seconds. Take into account that this also means that the connection
will be closed if your backend takes more than 5 seconds to generate a response or if there are
pauses by the backend during sending the response that last more than 5 seconds.


Regards

Rüdiger