You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Yuval Schwartz <yu...@gmail.com> on 2016/02/07 08:27:47 UTC

ELB Creating Multiple Sessions with Every Ping

tomcat version: 8.0.22
java: jdk1.8.0_05
server: amazon linux ami

This might be outside the scope of this forum.
I have an ELB (Elastic Load Balancer) distributing load between two
instances that run tomcat.
When I observe the tomcat manager app I see that at every health check
interval (1 per 60 seconds) the ELB is creating 4 new sessions (ie: 4
different session ids are listed in the "Sessions Adminstration" page per
ping). Is this normal? Why doesn't it just create 1 session per ping?

Thank you
_

Re: ELB Creating Multiple Sessions with Every Ping

Posted by Yuval Schwartz <yu...@gmail.com>.
On Mon, Feb 8, 2016 at 6:53 PM, Peter Rifel <pr...@mixpo.com> wrote:

> Yuval,
>
>
>
> On 2/8/16, 6:57 AM, "Christopher Schultz" <ch...@christopherschultz.net>
> wrote:
>
> >-----BEGIN PGP SIGNED MESSAGE-----
> >Hash: SHA1
> >
> >Yuval,
> >
> >On 2/7/16 2:27 AM, Yuval Schwartz wrote:
> >> tomcat version: 8.0.22 java: jdk1.8.0_05 server: amazon linux ami
> >>
> >> This might be outside the scope of this forum. I have an ELB
> >> (Elastic Load Balancer) distributing load between two instances
> >> that run tomcat. When I observe the tomcat manager app I see that
> >> at every health check interval (1 per 60 seconds) the ELB is
> >> creating 4 new sessions (ie: 4 different session ids are listed in
> >> the "Sessions Adminstration" page per ping). Is this normal? Why
> >> doesn't it just create 1 session per ping?
> >
> >Because the ELB doesn't maintain JSESSIONID cookies across pings.
>
> Also I've noticed in my Tomcat access logs that ELB health checks come
> from two different IP addresses and each performs a check at the defined
> interval, so you may see double the requests.
>
>
Yes, thank you. I read somewhere that ELB's ping from each instance running
the ELB (which is determined by load on the ELB), so it could fluctuate.
I'll look into this as well as Christopher's answer.


> Peter
>
>
>
>
> >
> >What you need to do is pick a different URL for the ELB to use to ping
> >the backend instances: one that won't automatically create a new session
> >.
> >
> >- -chris
> >-----BEGIN PGP SIGNATURE-----
> >Comment: GPGTools - http://gpgtools.org
> >Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/
> >
> >iEYEARECAAYFAla4rOQACgkQ9CaO5/Lv0PDnuwCdFqdNo6cZJO26fj0zvLFsr1Bw
> >48EAoLhRkEwSpB76yDIvBcEMNi8H/oqU
> >=2R3W
> >-----END PGP SIGNATURE-----
> >
> >---------------------------------------------------------------------
> >To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> >For additional commands, e-mail: users-help@tomcat.apache.org
> >
>

Re: ELB Creating Multiple Sessions with Every Ping

Posted by Peter Rifel <pr...@mixpo.com>.
Yuval,



On 2/8/16, 6:57 AM, "Christopher Schultz" <ch...@christopherschultz.net> wrote:

>-----BEGIN PGP SIGNED MESSAGE-----
>Hash: SHA1
>
>Yuval,
>
>On 2/7/16 2:27 AM, Yuval Schwartz wrote:
>> tomcat version: 8.0.22 java: jdk1.8.0_05 server: amazon linux ami
>> 
>> This might be outside the scope of this forum. I have an ELB
>> (Elastic Load Balancer) distributing load between two instances
>> that run tomcat. When I observe the tomcat manager app I see that
>> at every health check interval (1 per 60 seconds) the ELB is
>> creating 4 new sessions (ie: 4 different session ids are listed in
>> the "Sessions Adminstration" page per ping). Is this normal? Why
>> doesn't it just create 1 session per ping?
>
>Because the ELB doesn't maintain JSESSIONID cookies across pings.

Also I've noticed in my Tomcat access logs that ELB health checks come from two different IP addresses and each performs a check at the defined interval, so you may see double the requests.

Peter




>
>What you need to do is pick a different URL for the ELB to use to ping
>the backend instances: one that won't automatically create a new session
>.
>
>- -chris
>-----BEGIN PGP SIGNATURE-----
>Comment: GPGTools - http://gpgtools.org
>Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/
>
>iEYEARECAAYFAla4rOQACgkQ9CaO5/Lv0PDnuwCdFqdNo6cZJO26fj0zvLFsr1Bw
>48EAoLhRkEwSpB76yDIvBcEMNi8H/oqU
>=2R3W
>-----END PGP SIGNATURE-----
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>For additional commands, e-mail: users-help@tomcat.apache.org
>

Re: ELB Creating Multiple Sessions with Every Ping

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

Yuval,

On 2/7/16 2:27 AM, Yuval Schwartz wrote:
> tomcat version: 8.0.22 java: jdk1.8.0_05 server: amazon linux ami
> 
> This might be outside the scope of this forum. I have an ELB
> (Elastic Load Balancer) distributing load between two instances
> that run tomcat. When I observe the tomcat manager app I see that
> at every health check interval (1 per 60 seconds) the ELB is
> creating 4 new sessions (ie: 4 different session ids are listed in
> the "Sessions Adminstration" page per ping). Is this normal? Why
> doesn't it just create 1 session per ping?

Because the ELB doesn't maintain JSESSIONID cookies across pings.

What you need to do is pick a different URL for the ELB to use to ping
the backend instances: one that won't automatically create a new session
.

- -chris
-----BEGIN PGP SIGNATURE-----
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iEYEARECAAYFAla4rOQACgkQ9CaO5/Lv0PDnuwCdFqdNo6cZJO26fj0zvLFsr1Bw
48EAoLhRkEwSpB76yDIvBcEMNi8H/oqU
=2R3W
-----END PGP SIGNATURE-----

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