You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by John Rellis <jo...@gmail.com> on 2013/01/03 16:54:45 UTC

worker not marked as in error when shutdown with ping mode enabled

Hello folks,

I am using apache 2.2.3 and mod_jk as a load balancer for two tomcat 7
instances over AJP 1.3.

I am attempting to use the ping_mode option to enable workers to be
disabled when there is a tomcat out of memory error on one of the workers.

To test initially, I have set a ping_mode=A and it is my understanding that
this will ping the AJP connector every 100 seconds and mark the worker as
in error if it is not responding.

However, when I shutdown one of the workers, wait for a few minutes without
attempting connection, the worker does not become marked as in error on my
mod_jk status page.

Are my assumptions that shutting down the worker should see it marked as in
error on the jk status page correct?

Do I need to add anything to my "pre-ping_mode" tomcat configuration to get
this to work?

Do I need to add extra worker.properties configuration to get this to work?

Here is a sample from my worker.properties

worker.ajptemplate.type=ajp13
worker.ajptemplate.socket_connect_timeout=10000
worker.ajptemplate.ping_mode=A

worker.worker1.reference=worker.ajptemplate
worker.worker1.host=host
worker.worker1.port=8010

Many thanks,
John

-- 
John Rellis

Re: worker not marked as in error when shutdown with ping mode enabled

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

John,

On 1/6/13 11:18 AM, John Rellis wrote:
> As far as I was aware, setting a ping_mode of A would then in turn
> set a default value of 10,000 for ping_timeout.

Sorry, you're right... I'm not sure why I thought the ping_timeout
default was 0 (infinite).

> In turn this would then set a connection_ping_interval of 100
> seconds and a prepost_timeout of 10,000.
> 
> I gathered this information from the docs page but maybe they don't
> match up with my version????
> 
> http://tomcat.apache.org/connectors-doc/reference/workers.html
> 
> A prepost of 10,000 seems very high actually so I should probably
> change that.
> 
> These values that I expected by setting a ping_mode of A do seem to
> be populated in the jkmanager.  I will change them and see if I can
> have any success.

It might be a good idea to see what a packet sniffer can see between
these two hosts.

- -chris

-----BEGIN PGP SIGNATURE-----
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with undefined - http://www.enigmail.net/

iEYEAREIAAYFAlDp47oACgkQ9CaO5/Lv0PC6ugCgpiFPs2LogjHQlFgD3ZdR6y8y
jUoAn2L5Lc/OMBVnNpSsxiEy/OZ1vK9f
=lWSC
-----END PGP SIGNATURE-----

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


Re: worker not marked as in error when shutdown with ping mode enabled

Posted by John Rellis <jo...@gmail.com>.
On Fri, Jan 4, 2013 at 9:24 PM, Christopher Schultz <
chris@christopherschultz.net> wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA256
>
> Pid,
>
> On 1/4/13 3:22 PM, Pid wrote:
> > On 04/01/2013 20:08, Christopher Schultz wrote:
> >> On 1/3/13 10:54 AM, John Rellis wrote:
> >>>> I am using apache 2.2.3 and mod_jk as a load balancer for
> >>>> two tomcat 7 instances over AJP 1.3.
> >> Which exact version of mod_jk are you using? I'm guessing you
> >> are stuck on httpd 2.2.3 because of your package-manager? That's
> >> quite old.
> >
> > Some package managers report 2.2.3 despite it being a newer patch.
>
> ... though they usually only have the security-related patches, to
> keep things "stable".
>
> - -chris
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
> Comment: GPGTools - http://gpgtools.org
> Comment: Using GnuPG with undefined - http://www.enigmail.net/
>
> iEYEAREIAAYFAlDnSHoACgkQ9CaO5/Lv0PDZNACguIruRN053z4eUu2I1I/wZTv2
> 8uYAnAw7UIQoBfr9elVtT2MrUYgaTMvB
> =Ttsr
> -----END PGP SIGNATURE-----
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>
Hey,

Thanks for the response.

*Which exact version of mod_jk are you using? I'm guessing you are
stuck on httpd 2.2.3 because of your package-manager? That's quite old.*

I am using mod_jk/1.2.37.  Yes, I think I installed 2.2.3 because that is
what yum installed as I am using RHEL 5.

I didn't realise it was old so maybe I should look into upgrading it.

*How long is "a few minutes"?*
*
*
I shutdown one worker and waited 10 minutes and the worker was not marked
as unavailable, which I assumed ping_mode=A would do.


*You have not set any of the following:

connection_ping_interval
prepost_timeout
ping_timeout

The default for the first one is based upon the value for
ping_timeout. The defaults for the latter two are both 0 (zero).
Therefore, all these values are 0 for your setup.

Barring any bugs in your version of mod_jk (depends upon your
version), that should effectively disable periodic connection-pinging,
leaving you with only CONNECT and PREPOST testing.

Your ping_timeout is infinite (default=0=infinite) so depending upon
exactly what is happening with your Tomcat instance, you may wait
forever to set the worker to IN_ERROR.*


As far as I was aware, setting a ping_mode of A would then in turn set a
default value of 10,000 for ping_timeout.

In turn this would then set a connection_ping_interval of 100 seconds and a
prepost_timeout of 10,000.

I gathered this information from the docs page but maybe they don't match
up with my version????

http://tomcat.apache.org/connectors-doc/reference/workers.html

A prepost of 10,000 seems very high actually so I should probably change
that.

These values that I expected by setting a ping_mode of A do seem to be
populated in the jkmanager.  I will change them and see if I can have any
success

Many thanks!

John

-- 
John Rellis

Re: worker not marked as in error when shutdown with ping mode enabled

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Pid,

On 1/4/13 3:22 PM, Pid wrote:
> On 04/01/2013 20:08, Christopher Schultz wrote:
>> On 1/3/13 10:54 AM, John Rellis wrote:
>>>> I am using apache 2.2.3 and mod_jk as a load balancer for
>>>> two tomcat 7 instances over AJP 1.3.
>> Which exact version of mod_jk are you using? I'm guessing you
>> are stuck on httpd 2.2.3 because of your package-manager? That's
>> quite old.
> 
> Some package managers report 2.2.3 despite it being a newer patch.

... though they usually only have the security-related patches, to
keep things "stable".

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with undefined - http://www.enigmail.net/

iEYEAREIAAYFAlDnSHoACgkQ9CaO5/Lv0PDZNACguIruRN053z4eUu2I1I/wZTv2
8uYAnAw7UIQoBfr9elVtT2MrUYgaTMvB
=Ttsr
-----END PGP SIGNATURE-----

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


Re: worker not marked as in error when shutdown with ping mode enabled

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Pid,

On 1/4/13 3:22 PM, Pid wrote:
> On 04/01/2013 20:08, Christopher Schultz wrote:
>> On 1/3/13 10:54 AM, John Rellis wrote:
>>>> I am using apache 2.2.3 and mod_jk as a load balancer for
>>>> two tomcat 7 instances over AJP 1.3.
>> Which exact version of mod_jk are you using? I'm guessing you
>> are stuck on httpd 2.2.3 because of your package-manager? That's
>> quite old.
> 
> Some package managers report 2.2.3 despite it being a newer patch.

Good point. I think RHEL is one of those.

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with undefined - http://www.enigmail.net/

iEYEAREIAAYFAlDnSGIACgkQ9CaO5/Lv0PAkpwCdEGH8bGlcWpt0YvfG4bGXXtSV
BZYAnRRwmo+a9su8Ups/pcaKGBJzK3hV
=Fy+K
-----END PGP SIGNATURE-----

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


Re: worker not marked as in error when shutdown with ping mode enabled

Posted by Pid <pi...@pidster.com>.
On 04/01/2013 20:08, Christopher Schultz wrote:
> On 1/3/13 10:54 AM, John Rellis wrote:
>> > I am using apache 2.2.3 and mod_jk as a load balancer for two
>> > tomcat 7 instances over AJP 1.3.
> Which exact version of mod_jk are you using? I'm guessing you are
> stuck on httpd 2.2.3 because of your package-manager? That's quite old.

Some package managers report 2.2.3 despite it being a newer patch.


p



-- 

[key:62590808]


Re: worker not marked as in error when shutdown with ping mode enabled

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

John,

On 1/3/13 10:54 AM, John Rellis wrote:
> I am using apache 2.2.3 and mod_jk as a load balancer for two
> tomcat 7 instances over AJP 1.3.

Which exact version of mod_jk are you using? I'm guessing you are
stuck on httpd 2.2.3 because of your package-manager? That's quite old.

> I am attempting to use the ping_mode option to enable workers to
> be disabled when there is a tomcat out of memory error on one of
> the workers.
> 
> To test initially, I have set a ping_mode=A and it is my
> understanding that this will ping the AJP connector every 100
> seconds and mark the worker as in error if it is not responding.

ping_mode=A will ping the worker all the time: after a new connection,
before each request, and periodically.

> However, when I shutdown one of the workers, wait for a few minutes
> without attempting connection, the worker does not become marked as
> in error on my mod_jk status page.

How long is "a few minutes"?

> Are my assumptions that shutting down the worker should see it
> marked as in error on the jk status page correct?
> 
> Do I need to add anything to my "pre-ping_mode" tomcat
> configuration to get this to work?
> 
> Do I need to add extra worker.properties configuration to get this
> to work?
> 
> Here is a sample from my worker.properties
> 
> worker.ajptemplate.type=ajp13 
> worker.ajptemplate.socket_connect_timeout=10000 
> worker.ajptemplate.ping_mode=A

You have not set any of the following:

connection_ping_interval
prepost_timeout
ping_timeout

The default for the first one is based upon the value for
ping_timeout. The defaults for the latter two are both 0 (zero).
Therefore, all these values are 0 for your setup.

Barring any bugs in your version of mod_jk (depends upon your
version), that should effectively disable periodic connection-pinging,
leaving you with only CONNECT and PREPOST testing.

Your ping_timeout is infinite (default=0=infinite) so depending upon
exactly what is happening with your Tomcat instance, you may wait
forever to set the worker to IN_ERROR.

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with undefined - http://www.enigmail.net/

iEYEAREIAAYFAlDnNrcACgkQ9CaO5/Lv0PBaRwCfbdX4NS8/SuiPimHtlY0ObU77
j6oAoLs+V32OAFFE7wPNnUDYx1QgS2K2
=a2gV
-----END PGP SIGNATURE-----

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