You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Arunkumar Janarthanan <ar...@gmail.com> on 2009/12/10 22:44:35 UTC

Rerouting Traffic when number of connection increases

We have a 4 Apache & Tomcat instances running on and trying to setup a
custom message by redirecting user to different Apache instance with
"currently we are expereincing HIGH traffic, please visit later"

How this can be achieved ? Is there anyway I can find the total number of
connections in all 4 web servers and reroute the traffic ? or this should be
taken at load balancer or CDN level ?

Please advice.

Arun J

Re: Rerouting Traffic when number of connection increases

Posted by Tobias Crefeld <tc...@cataneo.eu>.
Am Thu, 10 Dec 2009 16:44:35 -0500
schrieb Arunkumar Janarthanan <ar...@gmail.com>:

> We have a 4 Apache & Tomcat instances running on and trying to setup a

What do you mean with "4 Apache & Tomcat" exactly?

> custom message by redirecting user to different Apache instance with
> "currently we are expereincing HIGH traffic, please visit later"

Is this a problem of overload of the Apache or of the Tomcats? If
Tomcat isn't answering the forwarded requests of an Apache-webserver
fast enough Apache will show a error-page (IIRC error code 503). You
could change the content of this page to something less mysterious. If
your application supports load balancing you could use mod_proxy or
mod_jk to use one Apache as load balancer but you should have carefully
tested the ability of your application to run in a load-balanced
environment (e.g. session handling, DB-connection pooling,...).

If your application is getting irreparable unstable by overload it
might help if you limit the number of connections that the
Apache-Tomcat-connector allows.


Gruß,
 Tobias.

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


Re: Rerouting Traffic when number of connection increases

Posted by Arunkumar Janarthanan <ar...@gmail.com>.
Nope, the servers are capable of managing upto 250k user loads , when it
goes beyond it blows up. So we were thinking to have such mechanism that if
user load goes more than such amount or if all Apache processing near to its
maximum to have the load directed to another maintanance instances.

Please advice.

On Thu, Dec 10, 2009 at 4:51 PM, Pid <pi...@pidster.com> wrote:

> On 10/12/2009 21:44, Arunkumar Janarthanan wrote:
>
>> We have a 4 Apache&  Tomcat instances running on and trying to setup a
>> custom message by redirecting user to different Apache instance with
>> "currently we are expereincing HIGH traffic, please visit later"
>>
>> How this can be achieved ? Is there anyway I can find the total number of
>> connections in all 4 web servers and reroute the traffic ? or this should
>> be
>> taken at load balancer or CDN level ?
>>
>
> The latter?  If the servers are experiencing high load and are unable to
> respond, I guess they aren't going to be able to display the alternative
> message.
>
>
> p
>
>  Please advice.
>>
>> Arun J
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>

Re: Rerouting Traffic when number of connection increases

Posted by Pid <pi...@pidster.com>.
On 10/12/2009 21:44, Arunkumar Janarthanan wrote:
> We have a 4 Apache&  Tomcat instances running on and trying to setup a
> custom message by redirecting user to different Apache instance with
> "currently we are expereincing HIGH traffic, please visit later"
>
> How this can be achieved ? Is there anyway I can find the total number of
> connections in all 4 web servers and reroute the traffic ? or this should be
> taken at load balancer or CDN level ?

The latter?  If the servers are experiencing high load and are unable to 
respond, I guess they aren't going to be able to display the alternative 
message.


p

> Please advice.
>
> Arun J
>


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


Re: Rerouting Traffic when number of connection increases

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

Arun,

On 12/10/2009 4:44 PM, Arunkumar Janarthanan wrote:
> We have a 4 Apache & Tomcat instances running on and trying to setup a
> custom message by redirecting user to different Apache instance with
> "currently we are experiencing HIGH traffic, please visit later"
> 
> How this can be achieved ? Is there anyway I can find the total number of
> connections in all 4 web servers and reroute the traffic ? or this should be
> taken at load balancer or CDN level ?

I would say this ought to be done at the lb level: you want all your
webapp's code to be devoted to serving requests, not deciding whether or
not to serve them.

If you don't have a load-balancer or anything like that, you can fake
one using httpd (okay, you can call that a lb, but that's really using a
web server for lb, not actually having an lb). Anyhow, if you configure
httpd to have more request processors than Tomcat (say, allow 300,000
requests to http but only 250,000 requests to TOmcat - that seems
high... do you mean 250k simultaneous requests, or 250k active users all
logged-in?) then you can configure mod_jk or mod_proxy to show an error
page when the connections fail.

It's not particularly elegant, but it should work.

If your problem is that, after 250k active logins, your server starts to
become unresponsive, then the solution is much different: keep a
semi-accurate session count and then write a filter that checks the
session count to see if it's "too high". If so, and the request doesn't
have an associated session/login already, then redirect the user to a
page that says "sorry, come back later". Remember to ignore that
particular page in your filter :)

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAksiZkYACgkQ9CaO5/Lv0PC9BQCeKS4g+qCYvOGRDDI/hGS5vR/z
av8AoIlr8rTEIrZC0Oot2r6kQfyGL29w
=uU7c
-----END PGP SIGNATURE-----

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