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 EEB0A108E6 for ; Tue, 3 Dec 2013 17:32:47 +0000 (UTC) Received: (qmail 32498 invoked by uid 500); 3 Dec 2013 17:32:44 -0000 Delivered-To: apmail-tomcat-users-archive@tomcat.apache.org Received: (qmail 32433 invoked by uid 500); 3 Dec 2013 17:32:44 -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 32420 invoked by uid 99); 3 Dec 2013 17:32:44 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 03 Dec 2013 17:32:43 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=5.0 tests=RCVD_IN_DNSWL_NONE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of dmikusa@gopivotal.com designates 209.85.192.179 as permitted sender) Received: from [209.85.192.179] (HELO mail-pd0-f179.google.com) (209.85.192.179) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 03 Dec 2013 17:32:38 +0000 Received: by mail-pd0-f179.google.com with SMTP id r10so20395784pdi.24 for ; Tue, 03 Dec 2013 09:32:18 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:content-type:mime-version:subject:from :in-reply-to:date:content-transfer-encoding:message-id:references:to; bh=vZtlM0H4bQZnPkX5Bbos65mhy6J5sdzwT/rdKWkvWZM=; b=Lhc5++jly7Yr9PUHOU7zrHsiMu1N/GHYL1B4Q3GjLtqJA5dsE/7KQUnATIPOvVEz0C NHoNgenSWuA5xcggNjGUYeLdnyQg76O5vh8kglecyGc1nJWgGjFaSklc2fUSPEXo7RwO m/9evZ+s5KCtT9bDvE6bag+t1J9zT/AnVTkm36veSn+ugP7ZduCWaPT11PRPLChNGmZZ xQ3sE66PQP1O/jcu0J4XQaGLU5nR/GTMZ4UoD2EbBkT+iSgRCWPRzdRZPJQbvQSK6IYL 6h0jx/1r/eW7dtf/Km/Le6XB6qyQj0CiwS57knmEjCxRNsu6VHjZGcV9l1kje7i2AqYi HK/w== X-Gm-Message-State: ALoCoQlneFykWUiib+LXKiE2h8E6M5pE7eWWnAd+3TksdOLPyeIL6e3DRB7CiWJ9y601eBYjvDh2 X-Received: by 10.68.132.38 with SMTP id or6mr40170162pbb.50.1386091938477; Tue, 03 Dec 2013 09:32:18 -0800 (PST) Received: from [192.168.0.6] (d118-75-246-224.col.wideopenwest.com. [75.118.224.246]) by mx.google.com with ESMTPSA id rz6sm136792218pab.22.2013.12.03.09.32.17 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 03 Dec 2013 09:32:17 -0800 (PST) Content-Type: text/plain; charset=iso-8859-1 Mime-Version: 1.0 (Mac OS X Mail 6.6 \(1510\)) Subject: Re: Pooled Connections Lost After 10 Minutes (600 seconds) From: Daniel Mikusa In-Reply-To: Date: Tue, 3 Dec 2013 12:32:14 -0500 Content-Transfer-Encoding: quoted-printable Message-Id: <0EF44945-C4CD-46DF-B729-DADD9092F404@gopivotal.com> References: <52991E6A.9020605@christopherschultz.net> To: "Tomcat Users List" X-Mailer: Apple Mail (2.1510) X-Virus-Checked: Checked by ClamAV on apache.org On Dec 3, 2013, at 12:14 PM, Tomcat Random = wrote: > I considered using a validation query but it seemed like extra = overhead > when the default behavior was not, um, behaving in the default way. The overhead is typically minimal. Running "SELECT 1" or some other = very simply query is not likely to bring your database to it's knees. = It might add a small amount of latency as the pool will need to execute = the query before it give the connection to your application, but that's = likely to be dwarfed by whatever your application does with the = connection after it gets it. If you are concerned you can do a couple things to make the process even = more lightweight. 1.) With MySQL and use "/* ping */ SELECT 1" as the validation query. = This is a special case with the MySQL JDBC driver that uses even less = resources. 2.) You can use the tomcat-jdbc connection pool which has a = validationInterval setting. This will ensure that the validation query = is only executed one time during the specified time interval. =20 ...or you can go without a validation query, but it's not something I = would recommend and not something I see done very often. The minimal = overhead is usually worth knowing that you get a valid connection from = the pool. Dan >=20 > On Tue, Dec 3, 2013 at 7:24 AM, Daniel Mikusa = wrote: >=20 >> On Dec 2, 2013 10:09 PM, "Neven Cvetkovic" = >> wrote: >>>=20 >>> On Dec 2, 2013 12:47 PM, "Tomcat Random" >> wrote: >>>>=20 >>>> Neven, thank you. >>>>=20 >>>> It was right there in my.cnf: 'wait_timeout=3D600' >>>>=20 >>>=20 >>> You're welcome :) >>>=20 >>> I am curious why tomcat didn't renew expired (terminated) idle >> connections >>> though. >>=20 >> It wouldn't know that the connections have been disconnected, since = they >> were disconnected server side. If the user added a validation query = then >> it could detect and remove the closed connections. >>=20 >> Dan >>=20 --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org For additional commands, e-mail: users-help@tomcat.apache.org