Re: ProxyTimeout Revisited

2007-06-16 Thread Ruediger Pluem
I put the docs guys on CC as there might be (hopefully :-)) someone over there
who is interested in cleaning up the documentation mess regarding this.

On 06/16/2007 02:17 AM, Jess Holle wrote:
 Ah, that would make sense -- but that's not what the docs say as you
 point out :-)
 
 -- 
 Jess Holle
 
 Rainer Jung wrote:
 
 I think you need to make a distinction between the timeout *attribute*
 on a BalancerMember and the one on a balancer itself. At least the
 code does the distinction (2.2.4).

 a) timeout for a Balancermember (aka worker): timeout waiting for a
 read or write on an existing backend connection to complete.

 b) timeout for a balancer: if it can't get a connection from the pool,
 it will try again in intervals of timeout*1000/100 milliseconds until
 timeout seconds have expired (i.e. 100 times) or it managed to get a
 connection,

Not the complete story IMHO. The balancer will run over its members as 
described above
(so 100 times, with a sleep of timeout*1000/100 ms in between).
But as soon as a member is found that is usable there might be an additional
waiting time depending on the settings of this member. If you have configured 
your
member with the acquire parameter it will wait up to acquire seconds for a 
connection to
become available in the pool that is either one is created if the current pool 
size
is smaller than max and all connections in the pool are used or there is a free 
connection
in the pool. If you have not used the acquire parameter, httpd will wait 
indefinitely for
a connection to become available. Of course this waiting period (limited / 
unlimited) can
only happen if

1. The value for max is set to a value lower than ThreadsPerChild.

2. Possibly if the value for max is unset or set to ThreadsPerChild with the 
event MPM.

3. We have a connection pool leak :-).


 I think the documentation does not correctly document the code for the
 a) part!

Yes, the documentation definitely needs some improvement.


 Regards,

 Rainer


 Jess Holle wrote:

 Okay, I'm still wondering about the future behavior based on the Re:
 ProxyTimeout does not work as documented thread (which is why I'm
 bothering the dev mailing list, since the thread is from there), but
 after some testing the current (2.2.4) behavior is clearly that:

   1. If no timeout is specified on proxy workers:
  * They will wait indefinitely for a free connection to the
back end.

No, but see my explanations above regarding acquire.


  * They will wait for ProxyTimeout or 300 seconds for a
response from the back end servers.

No. They will wait for the timeout set by the Timeout setting for this virtual 
server.
But this is wrong. It should be worker timeout / ProxyTimeout / Timeout in that 
order
with only having Timeout a default of 300 secs if not set.

   2. If a timeout is specified on proxy workers:
  * They will use this timeout as the time to wait for a free
connection.

No, see above.

  * They will use this timeout as the time to wait for a
response from the back end servers.

Yes, for mod_proxy_ajp, no for mod_proxy_http until you have applied r546128
(http://svn.apache.org/viewvc?view=revrev=546128). If you have not applied
r546128 (2.2.4) mod_proxy_http will use the Timeout setting of the virtual 
server.



 Everything but the last bullet item of (2) is crystal clear from the
 documentation.  That last bullet was clear as mud to me from the
 docs, though.

As said the documentation needs some improvements here.

Regards

Rüdiger


Re: pid_table (Was: Re: svn commit: r543511 - /httpd/httpd/branches/1.3.x/src/main/http_main.c)

2007-06-16 Thread Jim Jagielski

Status Update:

 The pid-table code is:
   o Applied to 1.3 branch
   o In httpd-2.0-pid-table branch (branches/2.0.x fork)
   o In httpd-2.2-pid-table branch (branches/2.2.x fork)
   o In httpd-pid-table branch (trunk fork)

Passes httpd-tests, as well as 'ab' with *very* small
MaxRequestsPerChild and Max/MinSpare* settings to
exercise the child fork/reap logic... so far, so good.
Proposal is to fold them into their respective branches
(or trunk) in anticipation of additional testing
and release. Comments?


Re: ProxyTimeout does not work as documented

2007-06-16 Thread Ruediger Pluem


On 05/21/2007 02:44 PM, Jim Jagielski wrote:

 
 The logic should be:
 
1. If a per-worker value is set, use that.
2. If not, then if a ProxyTimeout value is set, use that.
3. Otherwise, use Timeout
 
 +1 on fixing that :)
 

Digging somewhat deeper to actually do this I found the following
obstacle (hopefully I am wrong):

1. The right place to fix this is in ap_proxy_connect_backend
  (around line 2215 in proxy_util.c).

2. We do not have a proxy_server_conf parameter in ap_proxy_connect_backend
   like in ap_proxy_connect_to_backend.

3. ap_proxy_connect_backend is part of a public API (mod_proxy.h).

4. Fixing the prototype of ap_proxy_connect_backend to add a proxy_server_conf
   parameter thus requires a major bump. Thus this would not be backportable 
:-(.

I am not quite sure if we can do

void *sconf = s-module_config;
proxy_server_conf *conf = (proxy_server_conf *)
ap_get_module_config(sconf, proxy_module);

to get the proxy_server_conf in ap_proxy_connect_backend as we are calling
ap_proxy_connect_backend from mod_proxy_ajp / mod_proxy_http and so the symbol
proxy_module might not be present there.
At the very least it looks like an uncool way of obtaining the proxy_server_conf
here.

Suggestions?


Regards

Rüdiger




Re: pid_table (Was: Re: svn commit: r543511 - /httpd/httpd/branches/1.3.x/src/main/http_main.c)

2007-06-16 Thread Ruediger Pluem


On 06/16/2007 05:40 PM, Jim Jagielski wrote:
 Status Update:
 
  The pid-table code is:
o Applied to 1.3 branch
o In httpd-2.0-pid-table branch (branches/2.0.x fork)
o In httpd-2.2-pid-table branch (branches/2.2.x fork)
o In httpd-pid-table branch (trunk fork)
 
 Passes httpd-tests, as well as 'ab' with *very* small
 MaxRequestsPerChild and Max/MinSpare* settings to
 exercise the child fork/reap logic... so far, so good.

Thank you very much for pushing this forward.

 Proposal is to fold them into their respective branches
 (or trunk) in anticipation of additional testing
 and release. Comments?

I haven't got time so far to do any tests, but I only reviewed the code.
But given that and your review and test results I would propose the following:

1. Lets fold httpd-pid-table into trunk now.
2. Give it 72 hours (or less) there and then lets make the backport
   proposals for 2.0.x / 2.2.x.

Regards

Rüdiger