Kim, You mentiond "fool-proof"... Perhaps a multi-pronged approach is best, if you have the time and inclination to implement it.
1) Apps can have "issues" for lots of reasons (running out of memory, db load and/or locks, thread deadlocks, etc, etc.) In lots of cases the VM/Tomcat are "OK", but the app is not. With this in mind, if you can get your monitoring software to actually hit the app's core functionality itself, you can see if the app is responding, no matter if the VM/Tomcat are OK. Can you get your monitoring software to hit a non-trivial, non-access-controlled page? Can you get the monitor to login/logout every so often (say every few minutes)? How about building a health-check page in the app itself that queries all major resources like RDBMSs, and full text search engines, and LDAPs, etc and prints out status for all those? Depending on our access control setup, you can restrict access to the status page to your monitor (perpahs via IP address) or simply have that URL innaccessable from the public network. Also consider your tolerence for slowness. If the site is "up" but taking 20 seconds to respond, maybe that is "broken." So of the monitor can check for response times that will help. 2) For the OOME condition, Jeff beat me to it. You can also, for example, use JMX and an http adapter to query an Mbean for the current memory state and alert if you are above 90%. The alert can be an email. This pro-active approach (and a fast response to the alert ;-) means your app won't get to the point of being unresponsive. 3) Perhaps this is too obvious, but why is the app running out of memory? Is there a leak or is the number of simultaneous requests too much? Have you given the app enough headroom in terms of max heap? We've had apps that just suck memory like nuts and have many simultaneous users, but if the VM is sized large enough they are happy. 4) For (free) monitoring software that can help with some of this, check out http://www.nagios.org/. Nagios and Splunk are cool. It is awesome what this stuff does for the price! Hope this helps at least a little, Brian Horblit Brian D. Horblit Senior Principal Engineer Thomson Healthcare (303) 486-6697 (800) 525-9083 x 6697 www.thomsonhealthcare.com [EMAIL PROTECTED] -->-----Original Message----- -->From: Jeff Hoffmann [mailto:[EMAIL PROTECTED] -->Sent: Monday, August 20, 2007 10:25 AM -->To: Tomcat Users List -->Subject: Re: Does anyone have an approach to checking if -->Tomcat instance is UP? [stuff deleted...] -->If what you're concerned about is an OOME, you can have a -->JSP that queries the runtime memory usage and outputs -->something easily parsable to alert you to a (pending) problem. IE: --> -->Runtime rt = Runtime.getRuntime(); -->double used = rt.totalMemory()-rt.freeMemory(); double free -->= rt.freeMemory(); double available = -->rt.maxMemory()-rt.totalMemory(); double usedpercent = -->(used/rt.maxMemory()) * 100; double freepercent = -->(free/rt.maxMemory()) * 100; double availablepercent = -->(available/rt.maxMemory()) * 100; --> -->If your normal state is used % is < 50%, you could send out -->a warning when it goes to 70% or restart if it goes to 90%. --> -->-- -->Jeff Hoffmann -->Head Plate Spinner -->PropertyKey.com --> -->--------------------------------------------------------------------- -->To start a new topic, e-mail: users@tomcat.apache.org To -->unsubscribe, e-mail: [EMAIL PROTECTED] -->For additional commands, e-mail: [EMAIL PROTECTED] --> --> --------------------------------------------------------------------- To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]