Return-Path: Delivered-To: apmail-hbase-dev-archive@www.apache.org Received: (qmail 97638 invoked from network); 1 Mar 2011 20:09:00 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 1 Mar 2011 20:09:00 -0000 Received: (qmail 3814 invoked by uid 500); 1 Mar 2011 20:09:00 -0000 Delivered-To: apmail-hbase-dev-archive@hbase.apache.org Received: (qmail 3704 invoked by uid 500); 1 Mar 2011 20:08:59 -0000 Mailing-List: contact dev-help@hbase.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@hbase.apache.org Delivered-To: mailing list dev@hbase.apache.org Received: (qmail 3694 invoked by uid 99); 1 Mar 2011 20:08:59 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 01 Mar 2011 20:08:59 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of ryanobjc@gmail.com designates 209.85.210.169 as permitted sender) Received: from [209.85.210.169] (HELO mail-iy0-f169.google.com) (209.85.210.169) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 01 Mar 2011 20:08:52 +0000 Received: by iyf13 with SMTP id 13so5683794iyf.14 for ; Tue, 01 Mar 2011 12:08:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=AyV0yvav6MbwKKk/3GgIhQVqdlbHmsPTWCaXQJInZVU=; b=S95y/J7mUm68/71ebqbh1+ZGZyv4+nTx+YN7MqYV2Iz+CtShx7y3vqeWevIAtAErz3 J34hfKKX+ZdANRBNaoYFb+kuUtLzwzIxu6jn8s1eIQ+LZg87TQL00APwIKEMZ3ZW56fg 8y1piAzac2okD1Qv4CAtIwDxWiR212Kh89wZQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=F4P1z8N0a1KtME0BUv2He8lwdgjuDUYOw6Io6SuR37/RqEI3vpOTAdUkSu9brek5Hg /dQ7FF24FAbTup+VHuMa4ULMnZtXPaTF1toaisNWwM1ymKP8/ZGd0Lv40pG2OkRl8t4a 5tBvvItH31OU4g71u5npku8lqlJr5aIjQcPbU= MIME-Version: 1.0 Received: by 10.231.19.136 with SMTP id a8mr6793610ibb.73.1299010111464; Tue, 01 Mar 2011 12:08:31 -0800 (PST) Received: by 10.231.30.205 with HTTP; Tue, 1 Mar 2011 12:08:31 -0800 (PST) In-Reply-To: References: Date: Tue, 1 Mar 2011 12:08:31 -0800 Message-ID: Subject: Re: Coprocessor tax? From: Ryan Rawson To: dev@hbase.apache.org Cc: Gary Helmling Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org My own profiling shows that a read write lock can be up to 3-6% of the CPU budget in our put/get query path. Adding another one if not necessary would probably not be good. In fact in the region coprocessor the only thing the write lock is used for is the preClose and postClose, but looking in the implementation of those methods I don't really get why this is necessary. The write lock ensures single thread access, but there is nothing that prevents other threads from calling other methods AFTER the postClose? -ryan On Tue, Mar 1, 2011 at 12:02 PM, Gary Helmling wrote: > All the CoprocessorHost invocations should be wrapped in "if (cpHost !=3D > null)". =A0We could just added an extra check for whether any coprocessor= s are > loaded -- "if (cpHost !=3D null && cpHost.isActive())", something like th= at? > =A0Or the CoprocessorHost methods could do this checking internally. > > Either way should be relatively easy to bypass the lock acquisition. =A0I= s > there much overhead to acquiring a read lock if the write lock is never > taken though? (just wondering) > > > > On Tue, Mar 1, 2011 at 11:51 AM, Stack wrote: > >> So, I'm debugging something else but thread dumping I see a bunch of thi= s: >> >> >> "IPC Server handler 6 on 61020" daemon prio=3D10 tid=3D0x00000000422d280= 0 >> nid=3D0x7714 runnable [0x00007f1c5acea000] >> =A0 java.lang.Thread.State: RUNNABLE >> =A0 =A0 =A0 =A0at >> java.util.concurrent.locks.ReentrantReadWriteLock$Sync.fullTryAcquireSha= red(ReentrantReadWriteLock.java:434) >> =A0 =A0 =A0 =A0at >> java.util.concurrent.locks.ReentrantReadWriteLock$Sync.tryAcquireShared(= ReentrantReadWriteLock.java:404) >> =A0 =A0 =A0 =A0at >> java.util.concurrent.locks.AbstractQueuedSynchronizer.acquireShared(Abst= ractQueuedSynchronizer.java:1260) >> =A0 =A0 =A0 =A0at >> java.util.concurrent.locks.ReentrantReadWriteLock$ReadLock.lock(Reentran= tReadWriteLock.java:594) >> =A0 =A0 =A0 =A0at >> org.apache.hadoop.hbase.regionserver.RegionCoprocessorHost.prePut(Region= CoprocessorHost.java:532) >> =A0 =A0 =A0 =A0at >> org.apache.hadoop.hbase.regionserver.HRegion.doMiniBatchPut(HRegion.java= :1476) >> =A0 =A0 =A0 =A0at >> org.apache.hadoop.hbase.regionserver.HRegion.put(HRegion.java:1454) >> =A0 =A0 =A0 =A0at >> org.apache.hadoop.hbase.regionserver.HRegionServer.multi(HRegionServer.j= ava:2652) >> =A0 =A0 =A0 =A0at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Me= thod) >> =A0 =A0 =A0 =A0at >> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav= a:39) >> =A0 =A0 =A0 =A0at >> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor= Impl.java:25) >> =A0 =A0 =A0 =A0at java.lang.reflect.Method.invoke(Method.java:597) >> =A0 =A0 =A0 =A0at >> org.apache.hadoop.hbase.ipc.WritableRpcEngine$Server.call(WritableRpcEng= ine.java:309) >> =A0 =A0 =A0 =A0at >> org.apache.hadoop.hbase.ipc.HBaseServer$Handler.run(HBaseServer.java:106= 0) >> >> >> Do others? =A0I don't have any CPs loaded. =A0I'm wondering if we can do >> more to just avoid the CP codepath if no CPs loaded. >> >> St.Ack >> >