You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Jeff Trawick <tr...@gmail.com> on 2010/09/22 20:59:02 UTC

Re: svn commit: r1000130 - /httpd/httpd/trunk/docs/manual/mod/mod_proxy.xml

On Wed, Sep 22, 2010 at 2:37 PM, <tr...@apache.org> wrote:

> Author: trawick
> Date: Wed Sep 22 18:37:16 2010
> New Revision: 1000130
>
> URL: http://svn.apache.org/viewvc?rev=1000130&view=rev
> Log:
> follow up r956069 with additional clarifications
> about the connection pool and related parameters
> (yes, and fix part of those earlier "clarifications")
>
> Modified:
>    httpd/httpd/trunk/docs/manual/mod/mod_proxy.xml
>
> Modified: httpd/httpd/trunk/docs/manual/mod/mod_proxy.xml
> URL:
> http://svn.apache.org/viewvc/httpd/httpd/trunk/docs/manual/mod/mod_proxy.xml?rev=1000130&r1=1000129&r2=1000130&view=diff
>
> ==============================================================================
> --- httpd/httpd/trunk/docs/manual/mod/mod_proxy.xml (original)
> +++ httpd/httpd/trunk/docs/manual/mod/mod_proxy.xml Wed Sep 22 18:37:16
> 2010
> @@ -764,13 +764,12 @@ expressions</description>
>     using  <code>key=value</code> parameters, described in the table
>     below.</p>
>
> -    <p>Setting <code>min</code> will determine how many connections to
> -    the backend server will be retained after use.  Up to the
> -    Soft Maximum, or <code>smax</code>, number of connections will be
> -    created on demand.  Any connections above <code>smax</code> are
> -    subject to a time to live, or <code>ttl</code>.  Apache httpd will
> -    never create more than the Hard Maximum or, <code>max</code>,
> -    connections to the backend server.</p>
> +    <p>Setting <code>min</code> to non-zero allows connections to the
> +    backend server to be retained after use;


That last sentence is wrong, isn't it?  (I'm using the
two-steps-forward/one-step-back approach until I can't go any further.  At
least you don't have to look at the doc for apr_reslist_create() anymore ;)
)

I honestly don't know what min is used for since we only create connections
on demand, unless min=0 means don't retain, and min>0 means retain.

What I want to do as a user today: retain connections but don't use any if
they've been idle for >= origin-server-keepalive seconds.

ttl is the only timeout avail, so that has to be set to the origin's
keepalive timeout
ttl only applies to connections above smax, so smax needs to be set as low
as allowable

so perhaps

ProxyPass / http://xxx/   ttl=5  smax={0,1,whatever it will accept}

RE: svn commit: r1000130 - /httpd/httpd/trunk/docs/manual/mod/mod_proxy.xml

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


________________________________

	From: Jeff Trawick Sent: Donnerstag, 23. September 2010 14:17
	To: dev@httpd.apache.org
	Subject: Re: svn commit: r1000130 - /httpd/httpd/trunk/docs/manual/mod/mod_proxy.xml
	
	
	On Thu, Sep 23, 2010 at 6:11 AM, "Plüm, Rüdiger, VF-Group"  wrote:
	

		 


________________________________

			From: Jeff Trawick Sent: Donnerstag, 23. September 2010 12:05
			To: dev@httpd.apache.org
			Subject: Re: svn commit: r1000130 - /httpd/httpd/trunk/docs/manual/mod/mod_proxy.xml
			
			
			On Thu, Sep 23, 2010 at 2:03 AM, Ruediger Pluem  wrote:

			first, thanks for stepping in!
			




				> ttl is the only timeout avail, so that has to be set to the origin's
				> keepalive timeout
				> ttl only applies to connections above smax, so smax needs to be set as low
				> as allowable
				
				
				No. ttl is absolute. The resource list hands out no resources that have been
				idle in the resource list for more then ttl. So no need to fiddle with
				smax.
				


			I have a hard time believing both that and the apr_reslist_create() doc.  ttl is passed only to apr_reslist_create(), which says

			" * @param ttl If non-zero, sets the maximum amount of time in microseconds a
			 *            resource may be available while exceeding the soft limit."

			That seems to say that I can get resources that have been idle for more than ttl, as long as the soft limit wasn't exceeded. 
			 
			The docs are just wrong. You will see that code does something different :-)


	Yeah (this is getting almost comical).
	
	doc patch/wild assertions posted to dev@apr
	
	So far it seems that min is almost useless for proxy due to the loose relationship between reslist resource and connection (and thus shouldn't be emphasized at all), and smax is almost useless for any apr_reslist client, including proxy (and like min, it shouldn't be emphasized at all in the proxy doc).
	
	 
	+1
	 
	Regards
	 
	Rüdiger 
	 
	 


Re: svn commit: r1000130 - /httpd/httpd/trunk/docs/manual/mod/mod_proxy.xml

Posted by Jeff Trawick <tr...@gmail.com>.
On Thu, Sep 23, 2010 at 6:11 AM, "Plüm, Rüdiger, VF-Group" <
ruediger.pluem@vodafone.com> wrote:

>
>
>  ------------------------------
> *From:* Jeff Trawick *Sent:* Donnerstag, 23. September 2010 12:05
> *To:* dev@httpd.apache.org
> *Subject:* Re: svn commit: r1000130 -
> /httpd/httpd/trunk/docs/manual/mod/mod_proxy.xml
>
>  On Thu, Sep 23, 2010 at 2:03 AM, Ruediger Pluem  wrote:
>
> first, thanks for stepping in!
>
>>
>>
>>
>> > ttl is the only timeout avail, so that has to be set to the origin's
>> > keepalive timeout
>> > ttl only applies to connections above smax, so smax needs to be set as
>> low
>> > as allowable
>>
>> No. ttl is absolute. The resource list hands out no resources that have
>> been
>> idle in the resource list for more then ttl. So no need to fiddle with
>> smax.
>>
>
> I have a hard time believing both that and the apr_reslist_create() doc.
>  ttl is passed only to apr_reslist_create(), which says
>
> " * @param ttl If non-zero, sets the maximum amount of time in microseconds
> a
>  *            resource may be available while exceeding the soft limit."
>
> That seems to say that I can get resources that have been idle for more
> than ttl, as long as the soft limit wasn't exceeded.
>
> The docs are just wrong. You will see that code does something different
> :-)
>
>
Yeah (this is getting almost comical).

doc patch/wild assertions posted to dev@apr

So far it seems that min is almost useless for proxy due to the loose
relationship between reslist resource and connection (and thus shouldn't be
emphasized at all), and smax is almost useless for any apr_reslist client,
including proxy (and like min, it shouldn't be emphasized at all in the
proxy doc).

RE: svn commit: r1000130 - /httpd/httpd/trunk/docs/manual/mod/mod_proxy.xml

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


________________________________

	From: Jeff Trawick Sent: Donnerstag, 23. September 2010 12:05
	To: dev@httpd.apache.org
	Subject: Re: svn commit: r1000130 - /httpd/httpd/trunk/docs/manual/mod/mod_proxy.xml
	
	
	On Thu, Sep 23, 2010 at 2:03 AM, Ruediger Pluem  wrote:

	first, thanks for stepping in!
	




		> ttl is the only timeout avail, so that has to be set to the origin's
		> keepalive timeout
		> ttl only applies to connections above smax, so smax needs to be set as low
		> as allowable
		
		
		No. ttl is absolute. The resource list hands out no resources that have been
		idle in the resource list for more then ttl. So no need to fiddle with
		smax.
		


	I have a hard time believing both that and the apr_reslist_create() doc.  ttl is passed only to apr_reslist_create(), which says

	" * @param ttl If non-zero, sets the maximum amount of time in microseconds a
	 *            resource may be available while exceeding the soft limit."

	That seems to say that I can get resources that have been idle for more than ttl, as long as the soft limit wasn't exceeded. 
	 
	The docs are just wrong. You will see that code does something different :-)
	 

	Regards
	 
	Rüdiger


Re: svn commit: r1000130 - /httpd/httpd/trunk/docs/manual/mod/mod_proxy.xml

Posted by Jeff Trawick <tr...@gmail.com>.
On Thu, Sep 23, 2010 at 2:03 AM, Ruediger Pluem <rp...@apache.org> wrote:

first, thanks for stepping in!

>
>
> On 09/22/2010 08:59 PM, Jeff Trawick wrote:
> > On Wed, Sep 22, 2010 at 2:37 PM, <tr...@apache.org> wrote:
> >
> >> Author: trawick
> >> Date: Wed Sep 22 18:37:16 2010
> >> New Revision: 1000130
> >>
> >> URL: http://svn.apache.org/viewvc?rev=1000130&view=rev
> >> Log:
> >> follow up r956069 with additional clarifications
> >> about the connection pool and related parameters
> >> (yes, and fix part of those earlier "clarifications")
> >>
> >> Modified:
> >>    httpd/httpd/trunk/docs/manual/mod/mod_proxy.xml
> >>
> >> Modified: httpd/httpd/trunk/docs/manual/mod/mod_proxy.xml
> >> URL:
> >>
> http://svn.apache.org/viewvc/httpd/httpd/trunk/docs/manual/mod/mod_proxy.xml?rev=1000130&r1=1000129&r2=1000130&view=diff
> >>
> >>
> ==============================================================================
> >> --- httpd/httpd/trunk/docs/manual/mod/mod_proxy.xml (original)
> >> +++ httpd/httpd/trunk/docs/manual/mod/mod_proxy.xml Wed Sep 22 18:37:16
> >> 2010
> >> @@ -764,13 +764,12 @@ expressions</description>
> >>     using  <code>key=value</code> parameters, described in the table
> >>     below.</p>
> >>
> >> -    <p>Setting <code>min</code> will determine how many connections to
> >> -    the backend server will be retained after use.  Up to the
> >> -    Soft Maximum, or <code>smax</code>, number of connections will be
> >> -    created on demand.  Any connections above <code>smax</code> are
> >> -    subject to a time to live, or <code>ttl</code>.  Apache httpd will
> >> -    never create more than the Hard Maximum or, <code>max</code>,
> >> -    connections to the backend server.</p>
> >> +    <p>Setting <code>min</code> to non-zero allows connections to the
> >> +    backend server to be retained after use;
> >
> >
> > That last sentence is wrong, isn't it?  (I'm using the
> > two-steps-forward/one-step-back approach until I can't go any further.
>  At
> > least you don't have to look at the doc for apr_reslist_create() anymore
> ;)
> > )
> >
> > I honestly don't know what min is used for since we only create
> connections
> > on demand, unless min=0 means don't retain, and min>0 means retain.
> >
> > What I want to do as a user today: retain connections but don't use any
> if
> > they've been idle for >= origin-server-keepalive seconds.
> >
> > ttl is the only timeout avail, so that has to be set to the origin's
> > keepalive timeout
> > ttl only applies to connections above smax, so smax needs to be set as
> low
> > as allowable
>
> No. ttl is absolute. The resource list hands out no resources that have
> been
> idle in the resource list for more then ttl. So no need to fiddle with
> smax.
>

I have a hard time believing both that and the apr_reslist_create() doc.
 ttl is passed only to apr_reslist_create(), which says

" * @param ttl If non-zero, sets the maximum amount of time in microseconds
a
 *            resource may be available while exceeding the soft limit."

That seems to say that I can get resources that have been idle for more than
ttl, as long as the soft limit wasn't exceeded.

In fact the smax concept only exists for this nuance about ttl handling,
right?


> min only ensures that you always have at least min idle resources (of
> course
> only if this does not increase the total number above hmax).
> In the proxy case that does not mean that these resources have connections
> to the backend. These are only created during their first real use.
>

Understood, but I think that for proxy the min concept is very obscure
because the resource in this case is not the connection but some
implementation artifact.  Proxy admins think about connections, but min has
zero control on the number of connections; it only controls the number of
reslist elements, which is interesting in only very rare situations where
you care about preallocating the structure and associated pools.  Agreed?

The proxy doc needs to mention min as little as possible, and from a
different standpoint altogether (memory management, not connection
management).



> So in short: Just set ttl to the keepalive of the backend minus some race
> seconds
> for packet latency and don't care about the remaining stuff if don't want
> to
> for other reasons.
>

That's the best possible scenario for the admin.  I'll have to figure out
why it isn't working for me.

Thanks!

Re: svn commit: r1000130 - /httpd/httpd/trunk/docs/manual/mod/mod_proxy.xml

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

On 09/22/2010 08:59 PM, Jeff Trawick wrote:
> On Wed, Sep 22, 2010 at 2:37 PM, <tr...@apache.org> wrote:
> 
>> Author: trawick
>> Date: Wed Sep 22 18:37:16 2010
>> New Revision: 1000130
>>
>> URL: http://svn.apache.org/viewvc?rev=1000130&view=rev
>> Log:
>> follow up r956069 with additional clarifications
>> about the connection pool and related parameters
>> (yes, and fix part of those earlier "clarifications")
>>
>> Modified:
>>    httpd/httpd/trunk/docs/manual/mod/mod_proxy.xml
>>
>> Modified: httpd/httpd/trunk/docs/manual/mod/mod_proxy.xml
>> URL:
>> http://svn.apache.org/viewvc/httpd/httpd/trunk/docs/manual/mod/mod_proxy.xml?rev=1000130&r1=1000129&r2=1000130&view=diff
>>
>> ==============================================================================
>> --- httpd/httpd/trunk/docs/manual/mod/mod_proxy.xml (original)
>> +++ httpd/httpd/trunk/docs/manual/mod/mod_proxy.xml Wed Sep 22 18:37:16
>> 2010
>> @@ -764,13 +764,12 @@ expressions</description>
>>     using  <code>key=value</code> parameters, described in the table
>>     below.</p>
>>
>> -    <p>Setting <code>min</code> will determine how many connections to
>> -    the backend server will be retained after use.  Up to the
>> -    Soft Maximum, or <code>smax</code>, number of connections will be
>> -    created on demand.  Any connections above <code>smax</code> are
>> -    subject to a time to live, or <code>ttl</code>.  Apache httpd will
>> -    never create more than the Hard Maximum or, <code>max</code>,
>> -    connections to the backend server.</p>
>> +    <p>Setting <code>min</code> to non-zero allows connections to the
>> +    backend server to be retained after use;
> 
> 
> That last sentence is wrong, isn't it?  (I'm using the
> two-steps-forward/one-step-back approach until I can't go any further.  At
> least you don't have to look at the doc for apr_reslist_create() anymore ;)
> )
> 
> I honestly don't know what min is used for since we only create connections
> on demand, unless min=0 means don't retain, and min>0 means retain.
> 
> What I want to do as a user today: retain connections but don't use any if
> they've been idle for >= origin-server-keepalive seconds.
> 
> ttl is the only timeout avail, so that has to be set to the origin's
> keepalive timeout
> ttl only applies to connections above smax, so smax needs to be set as low
> as allowable

No. ttl is absolute. The resource list hands out no resources that have been
idle in the resource list for more then ttl. So no need to fiddle with
smax.
min only ensures that you always have at least min idle resources (of course
only if this does not increase the total number above hmax).
In the proxy case that does not mean that these resources have connections
to the backend. These are only created during their first real use.

So in short: Just set ttl to the keepalive of the backend minus some race seconds
for packet latency and don't care about the remaining stuff if don't want to
for other reasons.

Regards

Rüdiger

Re: svn commit: r1000130 - /httpd/httpd/trunk/docs/manual/mod/mod_proxy.xml

Posted by Jeff Trawick <tr...@gmail.com>.
On Wed, Sep 22, 2010 at 2:59 PM, Jeff Trawick <tr...@gmail.com> wrote:

> On Wed, Sep 22, 2010 at 2:37 PM, <tr...@apache.org> wrote:
>
>> Author: trawick
>> Date: Wed Sep 22 18:37:16 2010
>> New Revision: 1000130
>>
>> URL: http://svn.apache.org/viewvc?rev=1000130&view=rev
>> Log:
>> follow up r956069 with additional clarifications
>> about the connection pool and related parameters
>> (yes, and fix part of those earlier "clarifications")
>>
>> Modified:
>>    httpd/httpd/trunk/docs/manual/mod/mod_proxy.xml
>>
>> Modified: httpd/httpd/trunk/docs/manual/mod/mod_proxy.xml
>> URL:
>> http://svn.apache.org/viewvc/httpd/httpd/trunk/docs/manual/mod/mod_proxy.xml?rev=1000130&r1=1000129&r2=1000130&view=diff
>>
>> ==============================================================================
>> --- httpd/httpd/trunk/docs/manual/mod/mod_proxy.xml (original)
>> +++ httpd/httpd/trunk/docs/manual/mod/mod_proxy.xml Wed Sep 22 18:37:16
>> 2010
>> @@ -764,13 +764,12 @@ expressions</description>
>>     using  <code>key=value</code> parameters, described in the table
>>     below.</p>
>>
>> -    <p>Setting <code>min</code> will determine how many connections to
>> -    the backend server will be retained after use.  Up to the
>> -    Soft Maximum, or <code>smax</code>, number of connections will be
>> -    created on demand.  Any connections above <code>smax</code> are
>> -    subject to a time to live, or <code>ttl</code>.  Apache httpd will
>> -    never create more than the Hard Maximum or, <code>max</code>,
>> -    connections to the backend server.</p>
>> +    <p>Setting <code>min</code> to non-zero allows connections to the
>> +    backend server to be retained after use;
>
>
> That last sentence is wrong, isn't it?  (I'm using the
> two-steps-forward/one-step-back approach until I can't go any further.  At
> least you don't have to look at the doc for apr_reslist_create() anymore ;)
> )
>
> I honestly don't know what min is used for since we only create connections
> on demand, unless min=0 means don't retain, and min>0 means retain.
>

Is the following true about min?

min only controls how many of the potential retained connection structures
(1-max)  will be created when the reslist is created.  It has no bearing on
connections, only on when the reslist data and memory pools are created.  So
it only needs to be set to non-zero if the admin wants the pools associated
with the potential reslist elements to be created ASAP (for some cases that
would be in child init hooks).



> What I want to do as a user today: retain connections but don't use any if
> they've been idle for >= origin-server-keepalive seconds.
>
> ttl is the only timeout avail, so that has to be set to the origin's
> keepalive timeout
> ttl only applies to connections above smax, so smax needs to be set as low
> as allowable
>
> so perhaps
>
> ProxyPass / http://xxx/   ttl=5  smax={0,1,whatever it will accept}
>

I'm still having issues with conn-reset while trying to read the status line
from the origin server, using the following:

ProxyPass /proxy/ http://192.168.1.208:8080/weblogic/ min=0 ttl=5 smax=0