Return-Path: Delivered-To: apmail-db-derby-dev-archive@www.apache.org Received: (qmail 77352 invoked from network); 16 Dec 2005 15:48:12 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 16 Dec 2005 15:48:12 -0000 Received: (qmail 80595 invoked by uid 500); 16 Dec 2005 15:48:08 -0000 Delivered-To: apmail-db-derby-dev-archive@db.apache.org Received: (qmail 80553 invoked by uid 500); 16 Dec 2005 15:48:08 -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 80542 invoked by uid 99); 16 Dec 2005 15:48:07 -0000 X-ASF-Spam-Status: No, hits=1.3 required=10.0 tests=SPF_FAIL X-Spam-Check-By: apache.org Received: from [192.87.106.226] (HELO ajax.apache.org) (192.87.106.226) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 16 Dec 2005 07:48:07 -0800 Received: from ajax.apache.org (ajax.apache.org [127.0.0.1]) by ajax.apache.org (Postfix) with ESMTP id 072BE182 for ; Fri, 16 Dec 2005 16:47:46 +0100 (CET) Message-ID: <592460697.1134748066026.JavaMail.jira@ajax.apache.org> Date: Fri, 16 Dec 2005 16:47:46 +0100 (CET) From: "Knut Anders Hatlen (JIRA)" To: derby-dev@db.apache.org Subject: [jira] Updated: (DERBY-733) Starvation in RAFContainer.readPage() In-Reply-To: <1924988682.1133366610352.JavaMail.jira@ajax.apache.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N [ http://issues.apache.org/jira/browse/DERBY-733?page=all ] Knut Anders Hatlen updated DERBY-733: ------------------------------------- Attachment: DERBY-733-more-exception-handling.diff Attached patch (DERBY-733-more-exception-handling.diff) that addresses Mike's concerns for exception handling. If something goes wrong when locking, Derby will now fall back to the old behaviour. Derbyall ran without failures. % svn stat -q M java/engine/org/apache/derby/impl/store/raw/data/RAFContainer.java > Starvation in RAFContainer.readPage() > ------------------------------------- > > Key: DERBY-733 > URL: http://issues.apache.org/jira/browse/DERBY-733 > Project: Derby > Type: Improvement > Components: Performance, Store > Versions: 10.1.2.1, 10.2.0.0, 10.1.3.0, 10.1.2.2 > Environment: Solaris x86 and Linux with Sun JVM 1.5.0. Derby embedded and client/server. > Reporter: Knut Anders Hatlen > Assignee: Knut Anders Hatlen > Attachments: DERBY-733-more-exception-handling.diff, DERBY-733.diff, Insert.java, Select.java > > When Derby is completely disk bound, threads might be starved in > RAFContainer.readPage(). This is a real problem when multiple clients > are repeatedly accessing one or a small number of large tables. In > cases like this, I have observed very high maximum response times > (several minutes in the worst cases) on simple transactions. The > average response time is not affected by this. > The starvation is caused by a synchronized block in > RAFContainer.readPage(): > synchronized (this) { > fileData.seek(pageOffset); > fileData.readFully(pageData, 0, pageSize); > } > If many threads want to read pages from the same file, there will be a > long queue of threads waiting for this monitor. Since the Java > specification does not guarantee that threads waiting for monitors are > treated fairly, some threads might have to wait for a long time before > they get the monitor. (Usually, a couple of threads get full throughput > while the others have to wait.) -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira