Return-Path: X-Original-To: apmail-tomcat-users-archive@www.apache.org Delivered-To: apmail-tomcat-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 2CDE29A8F for ; Mon, 5 Mar 2012 13:07:18 +0000 (UTC) Received: (qmail 66402 invoked by uid 500); 5 Mar 2012 13:07:14 -0000 Delivered-To: apmail-tomcat-users-archive@tomcat.apache.org Received: (qmail 66327 invoked by uid 500); 5 Mar 2012 13:07:14 -0000 Mailing-List: contact users-help@tomcat.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Tomcat Users List" Delivered-To: mailing list users@tomcat.apache.org Received: (qmail 66318 invoked by uid 99); 5 Mar 2012 13:07:14 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 05 Mar 2012 13:07:14 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=5.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of M.Beier@enbw.com designates 195.35.72.125 as permitted sender) Received: from [195.35.72.125] (HELO mx2.enbw.com) (195.35.72.125) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 05 Mar 2012 13:07:08 +0000 Received: from s3q2103.enbw.net (unverified) by mx2.enbw.com (mailgate.enbw.com) with ESMTP id for ; Mon, 5 Mar 2012 14:04:12 +0100 Received: from S3Q2173.enbw.net ([169.254.2.181]) by s3q2103.enbw.net ([10.125.130.103]) with mapi; Mon, 5 Mar 2012 14:06:46 +0100 From: Beier Michael To: 'Tomcat Users List' Date: Mon, 5 Mar 2012 14:06:46 +0100 Subject: AW: Too many connections in keepalive state in jk threadpool Thread-Topic: Too many connections in keepalive state in jk threadpool Thread-Index: Acz5Vm4LQQf80kT7Svqyj6/rNbmsmABeJDmw Message-ID: <1CA7D5514D24754B93C9DF23AAFA06450AAAF9161F@S3Q2173.enbw.net> References: <1CA7D5514D24754B93C9DF23AAFA06450AAADC89AF@S3Q2173.enbw.net> <4F523F6A.7070601@kippdata.de> In-Reply-To: <4F523F6A.7070601@kippdata.de> Accept-Language: en-US, de-DE Content-Language: de-DE X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: en-US, de-DE Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Virus-Checked: Checked by ClamAV on apache.org Hallo Herr Jung, >-----Urspr=FCngliche Nachricht----- >Von: Rainer Jung [mailto:rainer.jung@kippdata.de]=20 > >Hallo Herr Beier, > >On 02.03.2012 11:19, Beier Michael wrote: >> Hi all, >> >> we're running tomcat 7.0.23 on sun jdk 1.6.0_29, connected=20 >via ajp to httpd 2.2.21 using mod_jk 1.2.32. >> >> I observed the behavior, that tomcat keeps threads in its=20 >ajp pool in keepalive state, regardless of which timeouts=20 >(connectionTimeout and keepAliveTimeout) are configured in tomcat. >> I tested three connector configurations and with all I see=20 >connections in tomcat server status where the "Time" value=20 >amounts up to several million milliseconds, which is more than=20 >configured in connectionTimeout/keepAliveTimeout. >> This results in having 60-80 percent of the thread pool=20 >being in state "keepAlive". >> >> 1) >> > maxThreads=3D"200" redirectPort=3D"8343"=20 >tomcatAuthentication=3D"false" >> keepAliveTimeout=3D"300000"=20 >connectionTimeout=3D"300000" /> >> 2) >> > maxThreads=3D"200" redirectPort=3D"8343"=20 >tomcatAuthentication=3D"false" >> keepAliveTimeout=3D"300000" /> >> 3) >> > maxThreads=3D"200" redirectPort=3D"8343"=20 >tomcatAuthentication=3D"false" /> >> >> In mod_jk the connection_pool_timeout is set to the same=20 >value as connectionTimeout (only in seconds, not milliseconds). >> I verified that the values are set correctly querying the=20 >parameters via JMX. >> >> How can I avoid having so many threads in keepalive state -=20 >I don't have any idea at the moment and can't see that there=20 >is an error in my configuration. > >Educated guess: you have an interval based cping/cpong=20 >connection check=20 >configured for mod_jk. You're right, that's the way cping/cpong was configured. >Any cping will wake up the thread waiting for data on the=20 >connection and=20 >will reset the timeouts. But a cping will be ommediately answered by a=20 >cpong and not update the "last request" time. So that would=20 >explain, why=20 >your connections never timeout though the Manager shows constantly=20 >increasing times for the last request seen. OK, that's an important information on the value of "Time" in tomcat server status. Maybe it should be added to jk worker docs and/or tomcat manager-howto. >Usually that feature would be activated for mo_jk using the=20 >JkWatchdogInterval in combination with ping_mode "I" or "A".=20 >In case you=20 >are unsure about the effects of the various jk configuration options,=20 >you might post them here (remove sensitive data before posting). > >I'd say the current behaviour is a bit problematic, but I don't see an=20 >easy improvement. So if your focus is on keeping the number of idle=20 >connections low you would need to switch off interval cpings. Cping=20 >before rquests and after opening connections are fine (improves=20 >stability and reduces the likeliness of race conditions). I disabled interval cping by setting "ping_mode =3D C,P" instead of "A". At the moment everything looks good and tomcat behaves as expected. Thank's for your help! Best regards, Michael Beier Team SIS OIOAW (Web Basis) =20 EnBW Systeme Infrastruktur Support GmbH Durlacher Allee 93 76131 Karlsruhe Tel.: +49 (7 21) 63 - 14545=20 Fax: +49 (7 21) 63 - 15099 mailto:m.beier@enbw.com EnBW Systeme Infrastruktur Support GmbH Sitz der Gesellschaft: Karlsruhe Handelsregister: Amtsgericht Mannheim =AD HRB 108550 Vorsitzender des Aufsichtsrats: Dr. Bernhard Beck Gesch=E4ftsf=FChrer: Jochen Adenau, Hans-G=FCnther Meier --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org For additional commands, e-mail: users-help@tomcat.apache.org