Return-Path: Delivered-To: apmail-db-derby-dev-archive@www.apache.org Received: (qmail 90917 invoked from network); 29 Sep 2009 14:29:41 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 29 Sep 2009 14:29:41 -0000 Received: (qmail 34082 invoked by uid 500); 29 Sep 2009 14:29:41 -0000 Delivered-To: apmail-db-derby-dev-archive@db.apache.org Received: (qmail 34054 invoked by uid 500); 29 Sep 2009 14:29:41 -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 34046 invoked by uid 99); 29 Sep 2009 14:29:41 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 29 Sep 2009 14:29:41 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 29 Sep 2009 14:29:37 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 2A75E234C046 for ; Tue, 29 Sep 2009 07:29:16 -0700 (PDT) Message-ID: <412281874.1254234556173.JavaMail.jira@brutus> Date: Tue, 29 Sep 2009 07:29:16 -0700 (PDT) From: "Knut Anders Hatlen (JIRA)" To: derby-dev@db.apache.org Subject: [jira] Updated: (DERBY-3024) Validation of shared plans hurts scalability In-Reply-To: <4914535.1187864790741.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/DERBY-3024?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Knut Anders Hatlen updated DERBY-3024: -------------------------------------- Issue & fix info: [Patch Available] > Validation of shared plans hurts scalability > -------------------------------------------- > > Key: DERBY-3024 > URL: https://issues.apache.org/jira/browse/DERBY-3024 > Project: Derby > Issue Type: Improvement > Components: SQL > Affects Versions: 10.4.1.3 > Environment: Sun Java SE 6, Solaris 10, Sun Fire V880 (8 CPUs) > Reporter: Knut Anders Hatlen > Priority: Minor > Attachments: patch-1a.diff, patch-1a.png, Values.java, values1.png > > > To investigate whether there was anything in the SQL execution layer that prevented scaling on a multi-CPU machine, I wrote a multi-threaded test which continuously executed "VALUES 1" using a PreparedStatement. I ran the test on a machine with 8 CPUs and expected the throughput to be proportional to the number of concurrent clients up to 8 clients (the same as the number of CPUs). However, the throughput only had a small increase from 1 to 2 clients, and adding more clients did not increase the throughput. Looking at the test in a profiler, it seems like the threads are spending a lot of time waiting to enter synchronization blocks in GenericPreparedStatement.upToDate() and BaseActivation.checkStatementValidity() (both of which are synchronized on the a GenericPreparedStatement object). > I then changed the test slightly, appending a comment with a unique thread id to the "VALUES 1" statement. That means the threads still did the same work, but each thread got its own plan (GenericPreparedStatement object) since the statement cache didn't regard the SQL text strings as identical. When I made that change, the test scaled more or less perfectly up to 8 concurrent threads. > We should try to find a way to make the scalability the same regardless of whether or not the threads share the same plan. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.