On Thu, 13 Sep 2001, Jonathan Eric Miller wrote:
> Date: Thu, 13 Sep 2001 21:00:01 -0500
> From: Jonathan Eric Miller <[EMAIL PROTECTED]>
> Reply-To: [EMAIL PROTECTED]
> To: [EMAIL PROTECTED]
> Subject: Re: The pitfalls in restarting tomcat
>
>
> ----- Original Message -----
> From: "Craig R. McClanahan" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Thursday, September 13, 2001 7:40 PM
> Subject: Re: The pitfalls in restarting tomcat
>
>
> >
> >
> > On Thu, 13 Sep 2001, Jonathan Eric Miller wrote:
> >
> > > Date: Thu, 13 Sep 2001 19:24:08 -0500
> > > From: Jonathan Eric Miller <[EMAIL PROTECTED]>
> > > Reply-To: [EMAIL PROTECTED]
> > > To: [EMAIL PROTECTED]
> > > Subject: Re: The pitfalls in restarting tomcat
> > >
> > > IMHO, it would still be nice to have a true easy way to completely
> restart
> > > Tomcat. For example, say you were running into memory leak problems or
> > > something like that. You might want to schedule a script to run once a
> day
> > > to restart the server. In a perfect world, one would never have to do
> this,
> > > but, sometimes you run into bugs and you want to make sure that things
> are
> > > completely reset.
> > >
> >
> > On Unix, many /etc/rc.d/init.d scripts I've seen implement their "restart"
> > command as a shutdown followed by a startup. Why is it any more
> > complicated than this?
>
> You have to put a pause in there too, otherwise you'll get an error message
> about the port already listening. This is because when you start it,
> sometimes, the previous instance hasn't stopped yet.
>
A pause won't cut it -- the amount of time a shutdown takes is
non-deterministic, because the destroy() method of all the initialized
servlets, filters, and the contextDestroyed() method of listeners is
called during the shutdown process. It would take code to do this
reliably.
> > Note also that, if you don't physically restart the JVM, you don't give
> > any of the memory it grabbed back to the operating system.
>
> The restart command that I'm thinking of would completely stop Tomcat and
> start it again, and also shut down the JVM. It would basically, run
> shutdown.sh and then startup.sh. However, the difference is that it would
> shut it down in a synchronous manner not asynchronous. Therefore, it would
> start the server back up immediately after it was shut down rather than
> pausing for an arbitrary period of time waiting for Tomcat to shut down.
>
> I think this may be becoming less of an issue than it was before. Prior to
> Tomcat 7, the shutdown process seemed very laggy. As of 7 it was a lot
> better. Now, with RC1, maybe it's just me, but, it seems even better yet.
>
There have been substantial improvements in RC1.
> On a somewhat unrelated note, but, speaking of lag, anyone know if Sun is
> planning doing anything to speed up the initialization of JSSE?
>
I would bet this is related to initializing the random number generator.
Do you *really* want to reduce the security of your cryptography?
The same issue shows up in Tomcat with initialization of the random number
generator used for session ids. The current initialization algorithm is
fast, but subject to predictable session ids if an attacker can read
server.xml.
> Jon
>
> > > Jon
> > >
> >
> > Craig
>
>
>
Craig