Return-Path: X-Original-To: apmail-db-derby-dev-archive@www.apache.org Delivered-To: apmail-db-derby-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id E377EF0FB for ; Sat, 23 Mar 2013 07:19:19 +0000 (UTC) Received: (qmail 45708 invoked by uid 500); 23 Mar 2013 07:19:19 -0000 Delivered-To: apmail-db-derby-dev-archive@db.apache.org Received: (qmail 45507 invoked by uid 500); 23 Mar 2013 07:19:18 -0000 Mailing-List: contact derby-dev-help@db.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: Delivered-To: mailing list derby-dev@db.apache.org Received: (qmail 45475 invoked by uid 99); 23 Mar 2013 07:19:17 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 23 Mar 2013 07:19:17 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of brett.wooldridge@gmail.com designates 209.85.215.179 as permitted sender) Received: from [209.85.215.179] (HELO mail-ea0-f179.google.com) (209.85.215.179) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 23 Mar 2013 07:19:12 +0000 Received: by mail-ea0-f179.google.com with SMTP id f15so1645898eak.10 for ; Sat, 23 Mar 2013 00:18:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:date:message-id:subject:from:to :content-type; bh=5i87HlwDjdd9MoBrDjQAp5PUKRKsegH/X8K8lyn94r8=; b=M0EtpsU3CshezsMtGZd0vUno+J3E+YZCgB6w/qFPdG5P9nFb+IKynx4NpEWasSkX6X A7safSX8hN/pLS9paHZdjyoiGTa1mU4FdS8ctIYsVI9BciiKOeW37XDIw/11zK4DvFe+ 5nox2YTCdbu1EZrBGlopcPI/CusQ1f+QXDQHHcYNE8Pcs9gposbNm5V/yiquMAfx0bEW FaqtFYesyEhiQQ4/ybbdBXJ90eB4FQxOgTlK3ZDU+ZCjB/PbsEIzAzgUfstFbJllKDJP jXqSRQ7TezyDWTW2WVXw77s0vPQSwGs4OEXA9jX6RgzrtQVjAL1ZTeHX1HRgtxa6bMBM k4/A== MIME-Version: 1.0 X-Received: by 10.14.183.67 with SMTP id p43mr12258218eem.10.1364023131398; Sat, 23 Mar 2013 00:18:51 -0700 (PDT) Received: by 10.223.159.207 with HTTP; Sat, 23 Mar 2013 00:18:51 -0700 (PDT) Date: Sat, 23 Mar 2013 16:18:51 +0900 Message-ID: Subject: Connection threads sticking around From: Brett Wooldridge To: derby-dev@db.apache.org Content-Type: multipart/alternative; boundary=047d7b3a805e36862904d89262dc X-Virus-Checked: Checked by ClamAV on apache.org --047d7b3a805e36862904d89262dc Content-Type: text/plain; charset=ISO-8859-1 I'm trying to figure out how Derby's network server manages threads, maybe someone with knowledge of that area can help. I have a client-side connection pool with a minimum of 10 connections, maximum of 100, and idle timeout of 300 seconds. Using JMX, I can see that the pool is indeed sitting at 10 connections. However, when I perform a thread dump on the server-side, I see that there are dozens of threads waiting on socket read() like this one: DRDAConnThread_19380 java.net.SocketInputStream.socketRead0(Native Method) java.net.SocketInputStream.read(SocketInputStream.java:150) java.net.SocketInputStream.read(SocketInputStream.java:121) org.apache.derby.impl.drda.DDMReader.fill(Unknown Source) org.apache.derby.impl.drda.DDMReader.ensureALayerDataInBuffer(Unknown Source) org.apache.derby.impl.drda.DDMReader.readDssHeader(Unknown Source) org.apache.derby.impl.drda.DRDAConnThread.processCommands(Unknown Source) org.apache.derby.impl.drda.DRDAConnThread.run(Unknown Source) Full dump of "DRDAConnThread" theads here: http://dpaste.com/1032074/ I do not understand why Derby is keeping these around once the client-side has closed the connection. What controls server-side connection (thread) retirement? If it is pooling them for efficiency, it still seems there must be a way to control how many/how long they live. Looking at the thread dump, something else interesting is that DRDAConnThread_0 thru 9 seemed to die off correctly. DRDAConnThread_10 thru 19 are still around. And then there is a jump in number to threads numbers > ~19300. Thanks in advance. Brett --047d7b3a805e36862904d89262dc Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
I'm trying to figure out how Derby's network serve= r manages threads, maybe someone with knowledge of that area can help.
=
I have a client-side connection pool with a minimum of= 10 connections, maximum of 100, and idle timeout of 300 seconds. =A0Using = JMX, I can see that the pool is indeed sitting at 10 connections. =A0Howeve= r, when I perform a thread dump on the server-side, I see that there are do= zens of threads waiting on socket read() like this one:
DRDACo=
nnThread_19380
java.net.SocketInputStream.socketRead0(Native Method)
java.net.SocketInputStream.read(SocketInputStream.java:150)
java.net.SocketInputStream.read(SocketInputStream.java:121)
org.apache.derby.impl.drda.DDMReader.fill(Unknown Source)
org.apache.derby.impl.drda.DDMReader.ensureALayerDataInBuffer(Unknown Sourc=
e)
org.apache.derby.impl.drda.DDMReader.readDssHeader(Unknown Source)
org.apache.derby.impl.drda.DRDAConnThread.processCommands(Unknown Source)
org.apache.derby.impl.drda.DRDAConnThread.run(Unknown Source)
Full dump of "DRDAConnThread" theads here:


I do not understand why Derby is keep= ing these around once the client-side has closed the connection. =A0What co= ntrols server-side connection (thread) retirement? =A0If it is pooling them= for efficiency, it still seems there must be a way to control how many/how= long they live.

Looking at the thread dump, something else = interesting is that DRDAConnThread_0 thru 9 seemed to die off correctly. = =A0DRDAConnThread_10 thru 19 are still around. =A0And then there is a jump = in number to threads numbers > ~19300.

=
Thanks in advance.

Br= ett

--047d7b3a805e36862904d89262dc--