You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Ronald Park <ro...@cnet.com> on 2008/01/17 23:35:26 UTC

mod_proxy and timeouts

Hi Folks,

I'm trying to get ProxyTimeout to work and having no luck.

I've set up 2 Apache instances in my network.  These are
Apache 2.0.59 servers built on a 64 bit Redhat EL4 box.

On the first, I've just added the following directives:

ProxyTimeout 2

ProxyPass /cgi-bin http://<myotherhost>/cgi-bin/

On the second machine, I have the following simple CGI:

#!/bin/sh
sleep 30
echo Content-type: text/html
echo
echo "<HTML><HEAD>"
echo "<TITLE>Hello</TITLE>"
echo "</HEAD><BODY>"
echo "Hello"
echo "</BODY></HTML>"

Why doesn't this timeout?

For 'fun', I' fiddled with the code, namely proxy_http.c,
right before the call to ap_proxy_connect_to_backend, I
reduce the value of 'timeout' in the conf struct by a factor
of 10 (so from 2000000 to 200000, etc) each request.  As
I reload the page, nothing different happens: each request
takes 30 secs to finally, successfully return... until I
finally get down to '200'.  Then, I finally get a 502,
BAD GATEWAY error.  So at that tiny timeout (200 microsecs?),
I'm guessing the low level connect times out.  So in some
regards, timeout is working.

I did find what I think is a bug in the merge_proxy_config
function... although it merges the 'timeout' field member
in the config structure, it's not merging the 'timeout_set'
member.  However, fixing that did not resolve my issue. :(

Is there something wrong with my test?

Thanks,
Ron