Reputation: 38878
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:
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.
Upvotes: 1
Views: 1362
Reputation: 21795
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.
Upvotes: 5