You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Arne Riecken <ar...@googlemail.com> on 2009/04/26 03:05:04 UTC

what is mod_jk parameter "connection_pool_timeout" in mod_proxy / mod_proxy_ajp / apache httpd?

Hello,

in the past I used mod_jk with workers with connection_pool_timeout=600 and
tomcat ajp connector with corresponding connectionTimeout=600000 as
recommended.

Now I additionally want to use mod_proxy_ajp with apache 2.2.9. Where in
apache httpd do I honour the tomcat connectionTimeout=600000 ?

Using apache2.2 prefork-mpm.

Thanks.

Re: what is mod_jk parameter "connection_pool_timeout" in mod_proxy / mod_proxy_ajp / apache httpd?

Posted by Rainer Jung <ra...@kippdata.de>.
On 06.05.2009 16:37, Arne Riecken wrote:
> Thank You very much, that seems to be the point for me. With mpm-prefork
> there is only one connection and if that cannot be closed due to timeout, I
> have a problem with firewall dropping. I posted already on this list on
> howto configure ajp keepalive, as an alternative. But on the other hand it
> seems not to be very wise to hold every connection open forever? I think we

The problem with keep alive is, that it is not enough to configure the
application (mod_proxy) to set the keep-live socket option for each
backend connection. You also have to tune your tcp stack on the apache
system to reduce the time interval the system waits, before it starts to
send the keep alive packets. Usually this time interval is 2 hours and
thus to long for most firewalls.

> will use the Apache that comes with the distribution, and that's 2.2.9, su
> upgrading is not an option. So I think we switch back to mod_jk.

Although of course I like people using mod_jk, you could also compile
mod_proxy and mod_proxy_* from a newer Apache httpd version against your
2.2.9 and only exchange the proxy modules. This should work, at least
I'm not aware of any module API incompatibilities.

It might be somewaht more tedious to find out how to do this exactly,
than to build mod_jk, because for mod_jk the build is always done
against an already installed Apache httpd.

Regards,

Rainer

> 2009/5/6 Rainer Jung <ra...@kippdata.de>
> 
>> Not 100% sure, whether this is part of the problem, but the changelog
>> contains:
>>
>> Changes with Apache 2.2.10
>>
>>  *) Allow for smax to be 0 for balancer members so that all idle
>>     connections are able to be dropped should they exceed ttl.
>>     PR 43371 [Phil Endecott <spam_from_apache_bugzilla chezphil.org>,
>>     Jim Jagielski]
>>
>> Since mod_proxy_ajp and mod_proxy_balancer are rapidly improving,
>> seriously try the latest (2.2.11).
>>
>> Regards,
>>
>> Rainer
>>
>> On 06.05.2009 14:41, Arne Riecken wrote:
>>> I need to either close the ajp connections or send keepalive messages
>>> because there is a firewall with a timeout of 1h between the
>> mod_proxy_ajp
>>> (Apache 2.2.9) and the JBoss Server with ajp connector and
>>>
>>> <Valve className="org.jboss.web.tomcat.service.jca.CachedConnectionValve"
>>>
>>>
>> cachedConnectionManagerObjectName="jboss.jca:service=CachedConnectionManager"
>>> transactionManagerObjectName="jboss:service=TransactionManager" />
>>>
>>> in server.xml.
>>>
>>> Setting
>>>
>>> BalancerMember ajp://hostname status=-H ping=3 smax=0 ttl=600
>>>
>>> did not help, even setting disablereuse did not help. After 1h idle time
>> the
>>> connections are broken. A restart of the Apache solves the problem.
>> Apache
>>> error log:
>>>
>>> [Wed May 06 08:45:20 2009] [error] (70007)The timeout specified has
>> expired:
>>> ajp_ilink_receive() can't receive hea
>>> der
>>> [Wed May 06 08:45:20 2009] [error] ajp_read_header: ajp_ilink_receive
>> failed
>>> [Wed May 06 08:45:20 2009] [error] (120006)APR does not understand this
>>> error code: proxy: read response failed from x.x.x.x:8009 (x.x.x.x)
>>>
>>>
>>> 2009/4/27 Rainer Jung <ra...@kippdata.de>
>>>
>>>>> Because I use mpm-prefork as mentioned, default smax=max=1. Does it
>> make
>>>>> sense to set smax to 0 to get a ttl for the one and only connection?
>>>> I would say "yes, it does make sense."
>>>>
>>>>> So
>>>>> "zero connections will be created on demand"? Is it bad not to have a
>> ttl
>>>>> for the one and only connection? When will that connection be closed
>>>> without
>>>>> ttl? When Tomcat connectionTimeout triggers?
>>>> Yes, but then you rely on httpd to correctly detect the closed
>>>> connection. Usually you do that via activating cping/cpong. I would use
>>>> a ttl value as a kind of double safety net.
>>>>
>>>> Whether closing idle connections or not is also related to
>>>>
>>>> - what kind of connection pool is the backend using (relation to backend
>>>> threads, and how precious your thread resources are)
>>>>
>>>> - are there other systems influencing idle connections between the web
>>>> server and the backend (like a firewall dropping idle connections)

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: what is mod_jk parameter "connection_pool_timeout" in mod_proxy / mod_proxy_ajp / apache httpd?

Posted by Arne Riecken <ar...@googlemail.com>.
Thank You very much, that seems to be the point for me. With mpm-prefork
there is only one connection and if that cannot be closed due to timeout, I
have a problem with firewall dropping. I posted already on this list on
howto configure ajp keepalive, as an alternative. But on the other hand it
seems not to be very wise to hold every connection open forever? I think we
will use the Apache that comes with the distribution, and that's 2.2.9, su
upgrading is not an option. So I think we switch back to mod_jk.

2009/5/6 Rainer Jung <ra...@kippdata.de>

> Not 100% sure, whether this is part of the problem, but the changelog
> contains:
>
> Changes with Apache 2.2.10
>
>  *) Allow for smax to be 0 for balancer members so that all idle
>     connections are able to be dropped should they exceed ttl.
>     PR 43371 [Phil Endecott <spam_from_apache_bugzilla chezphil.org>,
>     Jim Jagielski]
>
> Since mod_proxy_ajp and mod_proxy_balancer are rapidly improving,
> seriously try the latest (2.2.11).
>
> Regards,
>
> Rainer
>
> On 06.05.2009 14:41, Arne Riecken wrote:
> > I need to either close the ajp connections or send keepalive messages
> > because there is a firewall with a timeout of 1h between the
> mod_proxy_ajp
> > (Apache 2.2.9) and the JBoss Server with ajp connector and
> >
> > <Valve className="org.jboss.web.tomcat.service.jca.CachedConnectionValve"
> >
> >
> cachedConnectionManagerObjectName="jboss.jca:service=CachedConnectionManager"
> >
> > transactionManagerObjectName="jboss:service=TransactionManager" />
> >
> > in server.xml.
> >
> > Setting
> >
> > BalancerMember ajp://hostname status=-H ping=3 smax=0 ttl=600
> >
> > did not help, even setting disablereuse did not help. After 1h idle time
> the
> > connections are broken. A restart of the Apache solves the problem.
> Apache
> > error log:
> >
> > [Wed May 06 08:45:20 2009] [error] (70007)The timeout specified has
> expired:
> > ajp_ilink_receive() can't receive hea
> > der
> > [Wed May 06 08:45:20 2009] [error] ajp_read_header: ajp_ilink_receive
> failed
> > [Wed May 06 08:45:20 2009] [error] (120006)APR does not understand this
> > error code: proxy: read response failed from x.x.x.x:8009 (x.x.x.x)
> >
> >
> > 2009/4/27 Rainer Jung <ra...@kippdata.de>
> >
> >>> Because I use mpm-prefork as mentioned, default smax=max=1. Does it
> make
> >>> sense to set smax to 0 to get a ttl for the one and only connection?
> >> I would say "yes, it does make sense."
> >>
> >>> So
> >>> "zero connections will be created on demand"? Is it bad not to have a
> ttl
> >>> for the one and only connection? When will that connection be closed
> >> without
> >>> ttl? When Tomcat connectionTimeout triggers?
> >> Yes, but then you rely on httpd to correctly detect the closed
> >> connection. Usually you do that via activating cping/cpong. I would use
> >> a ttl value as a kind of double safety net.
> >>
> >> Whether closing idle connections or not is also related to
> >>
> >> - what kind of connection pool is the backend using (relation to backend
> >> threads, and how precious your thread resources are)
> >>
> >> - are there other systems influencing idle connections between the web
> >> server and the backend (like a firewall dropping idle connections)
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>

Re: what is mod_jk parameter "connection_pool_timeout" in mod_proxy / mod_proxy_ajp / apache httpd?

Posted by Rainer Jung <ra...@kippdata.de>.
Not 100% sure, whether this is part of the problem, but the changelog
contains:

Changes with Apache 2.2.10

  *) Allow for smax to be 0 for balancer members so that all idle
     connections are able to be dropped should they exceed ttl.
     PR 43371 [Phil Endecott <spam_from_apache_bugzilla chezphil.org>,
     Jim Jagielski]

Since mod_proxy_ajp and mod_proxy_balancer are rapidly improving,
seriously try the latest (2.2.11).

Regards,

Rainer

On 06.05.2009 14:41, Arne Riecken wrote:
> I need to either close the ajp connections or send keepalive messages
> because there is a firewall with a timeout of 1h between the mod_proxy_ajp
> (Apache 2.2.9) and the JBoss Server with ajp connector and
> 
> <Valve className="org.jboss.web.tomcat.service.jca.CachedConnectionValve"
> 
> cachedConnectionManagerObjectName="jboss.jca:service=CachedConnectionManager"
> 
> transactionManagerObjectName="jboss:service=TransactionManager" />
> 
> in server.xml.
> 
> Setting
> 
> BalancerMember ajp://hostname status=-H ping=3 smax=0 ttl=600
> 
> did not help, even setting disablereuse did not help. After 1h idle time the
> connections are broken. A restart of the Apache solves the problem. Apache
> error log:
> 
> [Wed May 06 08:45:20 2009] [error] (70007)The timeout specified has expired:
> ajp_ilink_receive() can't receive hea
> der
> [Wed May 06 08:45:20 2009] [error] ajp_read_header: ajp_ilink_receive failed
> [Wed May 06 08:45:20 2009] [error] (120006)APR does not understand this
> error code: proxy: read response failed from x.x.x.x:8009 (x.x.x.x)
> 
> 
> 2009/4/27 Rainer Jung <ra...@kippdata.de>
> 
>>> Because I use mpm-prefork as mentioned, default smax=max=1. Does it make
>>> sense to set smax to 0 to get a ttl for the one and only connection?
>> I would say "yes, it does make sense."
>>
>>> So
>>> "zero connections will be created on demand"? Is it bad not to have a ttl
>>> for the one and only connection? When will that connection be closed
>> without
>>> ttl? When Tomcat connectionTimeout triggers?
>> Yes, but then you rely on httpd to correctly detect the closed
>> connection. Usually you do that via activating cping/cpong. I would use
>> a ttl value as a kind of double safety net.
>>
>> Whether closing idle connections or not is also related to
>>
>> - what kind of connection pool is the backend using (relation to backend
>> threads, and how precious your thread resources are)
>>
>> - are there other systems influencing idle connections between the web
>> server and the backend (like a firewall dropping idle connections)

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: what is mod_jk parameter "connection_pool_timeout" in mod_proxy / mod_proxy_ajp / apache httpd?

Posted by Arne Riecken <ar...@googlemail.com>.
I need to either close the ajp connections or send keepalive messages
because there is a firewall with a timeout of 1h between the mod_proxy_ajp
(Apache 2.2.9) and the JBoss Server with ajp connector and

<Valve className="org.jboss.web.tomcat.service.jca.CachedConnectionValve"

cachedConnectionManagerObjectName="jboss.jca:service=CachedConnectionManager"

transactionManagerObjectName="jboss:service=TransactionManager" />

in server.xml.

Setting

BalancerMember ajp://hostname status=-H ping=3 smax=0 ttl=600

did not help, even setting disablereuse did not help. After 1h idle time the
connections are broken. A restart of the Apache solves the problem. Apache
error log:

[Wed May 06 08:45:20 2009] [error] (70007)The timeout specified has expired:
ajp_ilink_receive() can't receive hea
der
[Wed May 06 08:45:20 2009] [error] ajp_read_header: ajp_ilink_receive failed
[Wed May 06 08:45:20 2009] [error] (120006)APR does not understand this
error code: proxy: read response failed from x.x.x.x:8009 (x.x.x.x)


2009/4/27 Rainer Jung <ra...@kippdata.de>

> > Because I use mpm-prefork as mentioned, default smax=max=1. Does it make
> > sense to set smax to 0 to get a ttl for the one and only connection?
>
> I would say "yes, it does make sense."
>
> > So
> > "zero connections will be created on demand"? Is it bad not to have a ttl
> > for the one and only connection? When will that connection be closed
> without
> > ttl? When Tomcat connectionTimeout triggers?
>
> Yes, but then you rely on httpd to correctly detect the closed
> connection. Usually you do that via activating cping/cpong. I would use
> a ttl value as a kind of double safety net.
>
> Whether closing idle connections or not is also related to
>
> - what kind of connection pool is the backend using (relation to backend
> threads, and how precious your thread resources are)
>
> - are there other systems influencing idle connections between the web
> server and the backend (like a firewall dropping idle connections)
>
>

Re: what is mod_jk parameter "connection_pool_timeout" in mod_proxy / mod_proxy_ajp / apache httpd?

Posted by Rainer Jung <ra...@kippdata.de>.
On 27.04.2009 17:39, Arne Riecken wrote:
> Thanks, I did that bevore posting but did not understand id clearly. There
> is written:
> 
> "Any connections above smax are subject to a time to live or ttl. Apache
> will never create more than the Hard Maximum or max connections to the
> backend server."
> 
> "smax [...] Upto the Soft Maximum number of connections will be created on
> demand."
> 
> "max [...] In the Prefork MPM, this is always 1"
> 
> Because I use mpm-prefork as mentioned, default smax=max=1. Does it make
> sense to set smax to 0 to get a ttl for the one and only connection?

I would say "yes, it does make sense."

> So
> "zero connections will be created on demand"? Is it bad not to have a ttl
> for the one and only connection? When will that connection be closed without
> ttl? When Tomcat connectionTimeout triggers?

Yes, but then you rely on httpd to correctly detect the closed
connection. Usually you do that via activating cping/cpong. I would use
a ttl value as a kind of double safety net.

Whether closing idle connections or not is also related to

- what kind of connection pool is the backend using (relation to backend
threads, and how precious your thread resources are)

- are there other systems influencing idle connections between the web
server and the backend (like a firewall dropping idle connections)

Regards,

Rainer

> 2009/4/26 Rainer Jung <ra...@kippdata.de>
> 
>> Look for "ttl" on page http://httpd.apache.org/docs/2.2/mod/mod_proxy.html

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: what is mod_jk parameter "connection_pool_timeout" in mod_proxy / mod_proxy_ajp / apache httpd?

Posted by Arne Riecken <ar...@googlemail.com>.
Thanks, I did that bevore posting but did not understand id clearly. There
is written:

"Any connections above smax are subject to a time to live or ttl. Apache
will never create more than the Hard Maximum or max connections to the
backend server."

"smax [...] Upto the Soft Maximum number of connections will be created on
demand."

"max [...] In the Prefork MPM, this is always 1"

Because I use mpm-prefork as mentioned, default smax=max=1. Does it make
sense to set smax to 0 to get a ttl for the one and only connection? So
"zero connections will be created on demand"? Is it bad not to have a ttl
for the one and only connection? When will that connection be closed without
ttl? When Tomcat connectionTimeout triggers?



2009/4/26 Rainer Jung <ra...@kippdata.de>

> Look for "ttl" on page http://httpd.apache.org/docs/2.2/mod/mod_proxy.html
> .
>
>

Re: what is mod_jk parameter "connection_pool_timeout" in mod_proxy / mod_proxy_ajp / apache httpd?

Posted by Rainer Jung <ra...@kippdata.de>.
On 26.04.2009 03:05, Arne Riecken wrote:
> Hello,
> 
> in the past I used mod_jk with workers with connection_pool_timeout=600 and
> tomcat ajp connector with corresponding connectionTimeout=600000 as
> recommended.
> 
> Now I additionally want to use mod_proxy_ajp with apache 2.2.9. Where in
> apache httpd do I honour the tomcat connectionTimeout=600000 ?
> 
> Using apache2.2 prefork-mpm.

Look for "ttl" on page http://httpd.apache.org/docs/2.2/mod/mod_proxy.html.

Regards,

Rainer

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org