tags:

views:

88

answers:

1

My webapp runs on dedicated Tomcat instances on various platforms and hardware--mainly x86 Linux and Windows, but also Solaris and I develop on OS X. I've been generally surprised by the variance in shut down times between OSes. And tomcat generally seems slower so shutdown than other non-trivial services (httpd, mysql, squid.) So, a series of questions:

  • How long should tomcat take to shut down?
  • What causes tomcat to take longer to shut down than a simple "Hello World" servlet? What is a big impact, what is a little impact?
  • Why do I see such large discrepancies between platforms?

I'd really like specifics. I am half convinced that there are things in code I can do to improve shutdown times.

Times are generally no longer than 10-20s on some instances (high volume, RHEL4), but that seems excessively long to me.

+3  A: 

Are you explicitly starting a thread (or using an executor?). If you explicitly start threads but don't set them to be daemon threads, then this typically delays Tomcat shutdown. If you use an executor, supply your own ThreadFactory that creates daemon threads.

Neil Coffey
+1 I've had this issue explicitly. Other than this, shutdown times seem straightforward.
Steve B.
I'll take a look. But could you mention some times? Before and after would be great if you remember :)
Stu Thompson