tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Schultz <>
Subject Re: Rerouting Traffic when number of connection increases
Date Fri, 11 Dec 2009 15:33:26 GMT
Hash: SHA1


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
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla -


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message