Trouble with connection timeout settings
Hi, We're using Tomcat 6.0.24. We would like Tomcat to kill stuck threads after a certain period of time, but Tomcat doesn't appear to be doing this. Specifically, when the database doesn't return results, the connections just build up. Here are our settings in workers.properties worker.list=lbroute worker.lbroute.type=lb worker.lbroute.balance_workers=worker1,worker2 worker.worker1.type=ajp13 worker.worker1.host=xx.xx.xx.xx worker.worker1.port=8000 worker.worker1.lbfactor=1 worker.worker1.redirect=worker2 worker.worker1.socket_keepalive=true worker.worker1.connection_pool_timeout=60 worker.worker2.type=ajp13 worker.worker2.host=xx.xx.xx.xx worker.worker2.port=8000 worker.worker2.lbfactor=1 worker.worker2.activation=disabled worker.worker2.socket_keepalive=true worker.worker2.connection_pool_timeout=60 Does anyone see anything here that can be optimized or anything we might need to add to get Tomcat to kill stuck connections? - Dave -- View this message in context: http://old.nabble.com/Trouble-with-connection-timeout-settings-tp30826944p30826944.html Sent from the Tomcat - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Trouble with connection timeout settings
You mean set timeouts at the database level? What if the Tomcat thread is hung for some other reason? Is there any setting that will cause Tomcat to kill a thread if that thread is stuck? - Dave Mark Thomas wrote: On 02/02/2011 15:22, laredotornado wrote: Hi, We're using Tomcat 6.0.24. We would like Tomcat to kill stuck threads after a certain period of time, but Tomcat doesn't appear to be doing this. Specifically, when the database doesn't return results, the connections just build up. Here are our settings in workers.properties They won't help with this problem. You need to set timeouts on your database connections. Better still, fix whatever is causing those database queries to take so long. Mark - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org -- View this message in context: http://old.nabble.com/Trouble-with-connection-timeout-settings-tp30826944p30827517.html Sent from the Tomcat - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Trouble with connection timeout settings
On 02/02/2011 16:23, laredotornado wrote: You mean set timeouts at the database level? Yes. What if the Tomcat thread is hung for some other reason? Then you have an application bug to fix. Is there any setting that will cause Tomcat to kill a thread if that thread is stuck? - Dave No. Tomcat has no way of doing this. Mark - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Trouble with connection timeout settings
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 laredotornado, On 2/2/2011 11:23 AM, laredotornado wrote: You mean set timeouts at the database level? I would do it at the query level. The JDBC API has overloaded methods for Statement.executeQuery and friends that all take timeouts. It's possible that your database allows you to set a global (or session) timeout for all queries, but that's beyond the scope of anything Tomcat could provide for you. Is there any setting that will cause Tomcat to kill a thread if that thread is stuck? Tomcat can't tell the difference between a thread that is doing something useful or something not useful: only you can tell the difference. You are welcome to write some kind of sweeper thread that examines each thread at an interval and makes some objective (or subjective, I guess) decision about the state of the thread and call any number of methods on it including interrupt(), etc. - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.10 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAk1J6tkACgkQ9CaO5/Lv0PBzWQCgwsfm2besCJMPYs5x3gS3sKHN hgYAoJrYh5Dz5o+X8Dam+BEDpg9rTQja =iqvn -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org