tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tim Funk <>
Subject Re: One process per webapp
Date Wed, 15 Jun 2011 12:27:42 GMT
Observations ...

1) If relying on native - it might be easiest to place the
System.loadLibrary() and its classes in the common classloader. Then use a
Valve to call System.loadLibrary() so it's only called once. Hack, yes ...
also very simple to do. This might allow webapps to be reloaded without a
problem [depending on the nature of the change.]
2) apache httpd can easily handle the proxy scenario. Utilize the hot
standby feature and have it point to the primary Tomcat. Then when you wish
to restart ... you can bring up a new Tomcat which will be configured as the
hot standby. Then shutdown the primary Tomcat and all traffic goes to the
hot standby. Once the primary is down, change the proxy rules that now the
failover is the primary and the standby will be located in the config for
the next new tomcat instance. All the the proxy rules can be in an include.
(a really simple one - probably less then 10 lines) You'd also need some
httpd graceful restarts in there too to capture the new changes to the
include proxy rule file. All of the this can probably be easily scriptable.
(Even though there was a desire to avoid scripting)


On 6/14/2011 3:54 PM, cowwoc wrote:

seen:reload the entire JVM. Fixing this in the official release would benefit
anyone wishing to use JNI (or libraries that use JNI) from within Tomcat.
Nowadays with the rise of RESTful interfaces, it makes a lot more sense to
wrap a RESTful interface around libraries that interface with native code.


JVM. I'm talking about sticking a proxy (on port 80) that acts a front-man.
Then each webapp run in its own JVM in some custom port. The proxy redirects
traffic to the custom ports. Reloading webapps would do the following:

* Grab a blank (loaded without any webapps) Tomcat instance from some pool,
ask it to load the new webapp instance.
* The new instance runs in a different port than the existing instance
* We ask the proxy to forward traffic to the new port instead of the old one
* We ask the old instance to shut down
* Note that traffic moves across instances instantly (without waiting for
the old instance to shut down)

I wouldn't want to try implementing this in terms of simple script files.
It's a lot more involved.

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message