Return-Path: Delivered-To: apmail-jackrabbit-users-archive@locus.apache.org Received: (qmail 61176 invoked from network); 21 Sep 2006 16:57:54 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 21 Sep 2006 16:57:54 -0000 Received: (qmail 49157 invoked by uid 500); 21 Sep 2006 16:57:53 -0000 Delivered-To: apmail-jackrabbit-users-archive@jackrabbit.apache.org Received: (qmail 49136 invoked by uid 500); 21 Sep 2006 16:57:53 -0000 Mailing-List: contact users-help@jackrabbit.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@jackrabbit.apache.org Delivered-To: mailing list users@jackrabbit.apache.org Received: (qmail 49127 invoked by uid 99); 21 Sep 2006 16:57:52 -0000 Received: from idunn.apache.osuosl.org (HELO idunn.apache.osuosl.org) (140.211.166.84) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 21 Sep 2006 09:57:52 -0700 Authentication-Results: idunn.apache.osuosl.org header.from=the.mindstorm.mailinglist@gmail.com; domainkeys=good Authentication-Results: idunn.apache.osuosl.org smtp.mail=the.mindstorm.mailinglist@gmail.com; spf=pass X-ASF-Spam-Status: No, hits=0.5 required=5.0 tests=DNS_FROM_RFC_ABUSE Received-SPF: pass (idunn.apache.osuosl.org: domain gmail.com designates 66.249.92.170 as permitted sender) DomainKey-Status: good X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 Received: from [66.249.92.170] ([66.249.92.170:33017] helo=ug-out-1314.google.com) by idunn.apache.osuosl.org (ecelerity 2.1.1.8 r(12930)) with ESMTP id BE/30-03329-D84C2154 for ; Thu, 21 Sep 2006 09:57:50 -0700 Received: by ug-out-1314.google.com with SMTP id m3so866087uge for ; Thu, 21 Sep 2006 09:57:46 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=fimNjt6lOqqpnwLkXSJvVQMiJaxhbZ8ZY3hcHvfCjXi1Uie13sfAncr1C39UgZO9hf1D5IsEnQOejSiOhz2aGQJcd13dEOszRsdrMZjT1eo603BOL5wLVaqK3CRiVczXMk1Tfo7I1flPSN8IF4iZi3x4oF3m/7wDXkL+RAT1zdQ= Received: by 10.66.244.10 with SMTP id r10mr9461743ugh; Thu, 21 Sep 2006 09:57:46 -0700 (PDT) Received: by 10.66.232.15 with HTTP; Thu, 21 Sep 2006 09:57:46 -0700 (PDT) Message-ID: Date: Thu, 21 Sep 2006 19:57:46 +0300 From: "Alexandru Popescu" To: users@jackrabbit.apache.org Subject: Re: Working with JCR in highly concurrent applications In-Reply-To: <510143ac0609201441t3d3c9809v8686e14ff8dfbf86@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <510143ac0609200912m4e5dddcbm423a22e272b2e227@mail.gmail.com> <510143ac0609201036l1293d5c1w4ad4608e3232804d@mail.gmail.com> <510143ac0609201203y41a17d3fje9d24cb24ffd616b@mail.gmail.com> <510143ac0609201256h5bfbb875v6b199cdb9892f59f@mail.gmail.com> <510143ac0609201441t3d3c9809v8686e14ff8dfbf86@mail.gmail.com> X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N There is still some not yet answered question about JCR Session usage: can it be used as a long-live object and shared between different threads? Is it dangerous to do so? ./alex -- .w( the_mindstorm )p. On 9/21/06, Jukka Zitting wrote: > Hi, > > On 9/20/06, Jukka Zitting wrote: > > Another possible measure is of course count the total number of > > property reads within a given timeframe given any number of concurrent > > threads. That number should go up when the first few threads threads > > are added since the I/O waits can be used to process other threads, > > but then start slowly declining due to the context switching and other > > thread overhead. I'll actually run a test like that, stay tuned for > > the results... > > OK, here are the results for running the following code snippet over > and over again with a different numbers of concurrent threads: > > int i = (int) (Math.random() * 100); > int j = (int) (Math.random() * 100); > Node node = root.getNode("test" + i + "/test" + j); > node.getProperty("test").getString(); > > The results by the number of concurrent threads are listed below. The > reported time is the number of *microseconds* taken by the average > execution of the above code. > > Threads Time > 1 58 ************ > 2 50 ********** > 3 63 ************* > 4 63 ************* > 5 70 ************** > 6 71 ************** > 7 69 ************** > 8 68 ************** > 9 78 **************** > 10 86 ***************** > --------- > 20 118 ************************ > 30 113 *********************** > 40 123 ************************* > 50 129 ************************** > 60 135 *************************** > 70 142 **************************** > 80 146 ***************************** > 90 141 **************************** > 100 156 ******************************* > > As expected the number show an improvement when adding a second > thread, but already the third thread starts the slow decrease in > performance. The decrease is noticeably higher than just the threading > overhead, but the performance still quite reasonable, the average > execution time at 100 concurrent threads is just 2.5 times the > execution time at a single thread. > > BR, > > Jukka Zitting > > -- > Yukatan - http://yukatan.fi/ - info@yukatan.fi > Software craftsmanship, JCR consulting, and Java development >