> -----Original Message----- > From: Christopher Schultz [mailto:ch...@christopherschultz.net] > Sent: Thursday, November 11, 2010 10:18 AM > To: Tomcat Users List > Subject: Re: Any tools to detect tomcat services failure, and start it > again automatically? > > > Pid, > > On 11/11/2010 3:40 AM, Pid wrote: > > You could set CATALINA_PID and check that the process ID* contained > in > > the file is active. > > That is one way of doing things, but Tomcat might not be "healthy" even > though the process is running. For instance, I can imagine the > following > scenarios where the process would be running, but not considered > "healthy": > > 1. Database connection pool is exhausted - possibly permanently > 2. Request processing thread pool is exhausted - possibly permanently > 3. JVM has experienced an OOME and parts of Tomcat may be unstable > > That last one is very difficult to detect. ;)
What I have SEEN (which means there are probably things you've seen that I haven't) is: 1) JSVC terminates. I scripted around this by having a cron job run every two minutes, doing something like: PIDLIST=`ps -h -o pid -C jsvc` if [ -z "$PIDLIST"]; then // re-start tomcat fi 2) The JVM terminates and jsvc re-starts itself. The problem for me is that I dynamically add/remove virtual hosts. I'm in the middle of re-working things so that a file gets included by server.xml and that file is kept up to date. I'm fighting this right now. The JVM crashes in the hotspot compiler when it tries to request 2GB of memory... I've turned it in as a bug but haven't heard anything. This particular thing started with JDK 1.6.0_21. I suppose I could go back, but the garbage collector seems to be MUCH better in 1.6.0_21 so I live with it. 3) The JVM just hangs on OOME. This could probably be caught by using a cron job with wget and if a timeout happens kill the JSVC application and then re-start it. > > In these cases, a Tomcat bounce might be the best action to take. > > - -chris George Sexton MH Software, Inc. 303 438-9585 www.mhsoftware.com --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org