On Fri, 2008-07-04 at 00:54 -0700, Antonio Parolini wrote: > Hello, > > We use Tomcat 5.5.23 > > Using the command "catalina.sh stop" interrupts abruptly any working servlet > threads and stop Tomcat. > > Is there a way of shutting tomcat gracefully? > > For me, an example of graceful shutdown would be: > 1) The HTTP connector stop accepting new requests > 2) Tomcat wait that all the servlet threads finish (without interrupting > them as it does today) > 3) Shutdown the server > > Thanks for your advises, > > Antonio > > NB: I've seen that jk2 connector did something about this, but we are not > using Apache as our front end.
Hi Antonio, I researched a method to do this some time ago, using Apache httpd with mod_jk. The goal was to be able to run multiple tomcat instances (load balanced, but not clustered) and be able to take single instances down with no end-user impact. It was roughly along these lines: 1) Define a status worker [1] and one (or more) workers. 2) When you wish to shut down a tomcat instance, use the status worker to quiesce the worker for the tomcat instance you are stopping. I don't recall the exact status that needs to be used here, but I believe there was one that would result in no new sessions being established on a worker, but existing sessions are able to proceed. 3) Monitor the worker traffic to see when the remaining sessions appears to have ceased. 4) Stop the tomcat instance. However when we tried to implement this setup, it did not work quite as expected. Cheers, Ben [1] http://tomcat.apache.org/connectors-doc/reference/status.html --------------------------------------------------------------------- To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]