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/05/06 14:41:02 UTC

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

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 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