Return-Path: Delivered-To: apmail-lucene-java-dev-archive@www.apache.org Received: (qmail 54498 invoked from network); 2 May 2009 13:33:55 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 2 May 2009 13:33:55 -0000 Received: (qmail 69794 invoked by uid 500); 2 May 2009 13:33:53 -0000 Delivered-To: apmail-lucene-java-dev-archive@lucene.apache.org Received: (qmail 69710 invoked by uid 500); 2 May 2009 13:33:53 -0000 Mailing-List: contact java-dev-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: java-dev@lucene.apache.org Delivered-To: mailing list java-dev@lucene.apache.org Received: (qmail 69702 invoked by uid 99); 2 May 2009 13:33:53 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 02 May 2009 13:33:53 +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; Sat, 02 May 2009 13:33:51 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 6B4E7234C003 for ; Sat, 2 May 2009 06:33:30 -0700 (PDT) Message-ID: <1161503158.1241271210424.JavaMail.jira@brutus> Date: Sat, 2 May 2009 06:33:30 -0700 (PDT) From: "Yonik Seeley (JIRA)" To: java-dev@lucene.apache.org Subject: [jira] Commented: (LUCENE-1609) Eliminate synchronization contention on initial index reading in TermInfosReader ensureIndexIsRead In-Reply-To: <882447801.1240500510413.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/LUCENE-1609?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12705279#action_12705279 ] Yonik Seeley commented on LUCENE-1609: -------------------------------------- bq. If it's only for segment merging, couldn't we up front conditionalize the loading of the index? Since the indexWriter now does deletes, doesn't it sometimes need the term index too? > Eliminate synchronization contention on initial index reading in TermInfosReader ensureIndexIsRead > --------------------------------------------------------------------------------------------------- > > Key: LUCENE-1609 > URL: https://issues.apache.org/jira/browse/LUCENE-1609 > Project: Lucene - Java > Issue Type: Improvement > Components: Index > Affects Versions: 2.9 > Environment: Solr > Tomcat 5.5 > Ubuntu 2.6.20-17-generic > Intel(R) Pentium(R) 4 CPU 2.80GHz, 2Gb RAM > Reporter: Dan Rosher > Fix For: 2.9 > > Attachments: LUCENE-1609.patch, LUCENE-1609.patch > > > synchronized method ensureIndexIsRead in TermInfosReader causes contention under heavy load > Simple to reproduce: e.g. Under Solr, with all caches turned off, do a simple range search e.g. id:[0 TO 999999] on even a small index (in my case 28K docs) and under a load/stress test application, and later, examining the Thread dump (kill -3) , many threads are blocked on 'waiting for monitor entry' to this method. > Rather than using Double-Checked Locking which is known to have issues, this implementation uses a state pattern, where only one thread can move the object from IndexNotRead state to IndexRead, and in doing so alters the objects behavior, i.e. once the index is loaded, the index nolonger needs a synchronized method. > In my particular test, this uncreased throughput at least 30 times. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. --------------------------------------------------------------------- To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org For additional commands, e-mail: java-dev-help@lucene.apache.org