Return-Path: X-Original-To: apmail-hbase-dev-archive@www.apache.org Delivered-To: apmail-hbase-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 52DC810514 for ; Sat, 12 Oct 2013 03:56:25 +0000 (UTC) Received: (qmail 39755 invoked by uid 500); 12 Oct 2013 03:56:20 -0000 Delivered-To: apmail-hbase-dev-archive@hbase.apache.org Received: (qmail 39684 invoked by uid 500); 12 Oct 2013 03:56:20 -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 39673 invoked by uid 99); 12 Oct 2013 03:56:18 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 12 Oct 2013 03:56:18 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=5.0 tests=RCVD_IN_DNSWL_NONE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [72.30.234.147] (HELO n8-vm8.bullet.mail.bf1.yahoo.com) (72.30.234.147) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 12 Oct 2013 03:56:12 +0000 Received: from [66.196.81.177] by n8.bullet.mail.bf1.yahoo.com with NNFMP; 12 Oct 2013 03:55:51 -0000 Received: from [98.139.212.230] by t7.bullet.mail.bf1.yahoo.com with NNFMP; 12 Oct 2013 03:55:51 -0000 Received: from [127.0.0.1] by omp1039.mail.bf1.yahoo.com with NNFMP; 12 Oct 2013 03:55:51 -0000 X-Yahoo-Newman-Property: ymail-3 X-Yahoo-Newman-Id: 173984.17696.bm@omp1039.mail.bf1.yahoo.com Received: (qmail 99725 invoked by uid 60001); 12 Oct 2013 03:55:51 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1381550151; bh=VPf7J1BRHsNT2xSsJ78jy+PcPbJAdAfD/xABOmXkksU=; h=X-YMail-OSG:Received:X-Rocket-MIMEInfo:X-RocketYMMF:X-Mailer:References:Message-ID:Date:From:Reply-To:Subject:To:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=pHau2s8CnaMb6F+lqXcL7Zh/1zos6cR2nQiZBCPJt8NS8cEA7JCUTrqL6m9hlv70gj/lFaKVSZrF8eUxifm3I5/AxBdqey+HsHVBn3RqpN7ce8aWhrcS8hDOQG18pPNZCCgpTqBEEURjsOyqb+6ivd1/oKCdqAszj4pQ/zeDP7c= DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=X-YMail-OSG:Received:X-Rocket-MIMEInfo:X-RocketYMMF:X-Mailer:References:Message-ID:Date:From:Reply-To:Subject:To:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=RRv6/2ByIKZKqxIaKydusYkqPKhPMBc7CKtdIhHkuUFnOxzW+P/s5yCHT42G1qleR+94s/rjbXhID/qzp5VtECgRaNddxtVyhUNmv9i45tIzaiaaKTpdIGIH8BVsSw0C1KQoxvflxjJ0ACnjhXaMjm6GzxWr+isRP/KCZpMTHQ8=; X-YMail-OSG: LsVTvY8VM1mDDVQ8BcW4_m_AaJipY2RN2ORG1uEdKHbJMi6 MeQ8gw6e3QZJMC0ZQz0jMiSvVt2rkSi6DQoh7DzcnBbCQvSB4Sy4Y6OO1y4M E7By93MRYKnUswzA2a0wkPf7XBGCuScKmjfHYMCk6FOXRpOX3eoAB7Q_EmTJ DZTOKFY0wc_QM9PAS7t4FvHOD14XOpVW.gO4uFUu4VF3Xz9ySylsup7ukQC1 xzuS83zHVcz_Qxq4Ky0ifkd4jtSlIaZQgrmX2h8lGmPjHoJhqYl1XuW8Oqpk Al8gD65WcOcFtNl5cc3pUWumLHJbqUiqaIbuhY3cRsyDzPIsVvN30a.04wQp jrK_6cgPfBxZMRq1c_hrURnZgYW5d.yq5RN8VbA8hyUoTJCVEUSnkJBhqRu7 OS07vPjK98YQbJWAkFkOuO8bmZBRlX.NWIAug6te35ap2aL1Swjd_PEwF_Tz WFbICdQZK2BQ7wQISvnC3E8qTF5Xi2c8qUg7ok1ZP11Ri9f6DkVAbAnnFcif eZpwBVkpoZcbokEHPE0X2fO91Q8U8k28c3rRAh9mkCMaDEu0F9dOQd9JQnNM dzJQMydSyyE3H3Q24azig2N1H2pYTXTKnJdy.cz2o2Z9G66C.SAy067SCSwN rp5azyYxf9vg9t4CWd7q8pu1XtadyYIKmUoFR9hhn Received: from [24.4.148.188] by web140604.mail.bf1.yahoo.com via HTTP; Fri, 11 Oct 2013 20:55:51 PDT X-Rocket-MIMEInfo: 002.001,VGFraW5nIGEgcXVpY2sgbG9vay4uLiBJdCBpcyBlYXN5IHRvIHJlZHVjZSB0aGUgVGhyZWFkTG9jYWwgY2FsbHMgYnkgNTAlIHdpdGhvdXQgYW55IHJlZmFjdG9yaW5nIGluIHRoZSBNZW1zdG9yZS4KCkFsc28gdGhpbmtpbmcgYWJvdXQgdGhpcyBtb3JlLCB3ZSBhbHJlYWR5IGhhdmUgbWV0YWRhdGEgaW4gSEZpbGUgYWJvdXQgdGhlIG5ld2VzdCBtZW1zdG9yZVRTOyBJIHVzZWQgdGhhdCBvcHRpbWl6ZSBzdG9yaW5nIHRoZSBtZW1zdG9yZVRTIGluIEhGaWxlcyBhd2F5IChIQkFTRS04MTY2IGFuZCBIQkFTRS0BMAEBAQE- X-RocketYMMF: lhofhansl X-Mailer: YahooMailWebService/0.8.160.587 References: <1381541319.43070.YahooMailNeo@web140603.mail.bf1.yahoo.com> Message-ID: <1381550151.97473.YahooMailNeo@web140604.mail.bf1.yahoo.com> Date: Fri, 11 Oct 2013 20:55:51 -0700 (PDT) From: lars hofhansl Reply-To: lars hofhansl Subject: Re: skipKVsNewerThanReadpoint in StoreFileScanner and MemStoreScanner To: "dev@hbase.apache.org" , lars hofhansl In-Reply-To: <1381541319.43070.YahooMailNeo@web140603.mail.bf1.yahoo.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org Taking a quick look... It is easy to reduce the ThreadLocal calls by 50% wi= thout any refactoring in the Memstore.=0A=0AAlso thinking about this more, = we already have metadata in HFile about the newest memstoreTS; I used that = optimize storing the memstoreTS in HFiles away (HBASE-8166 and HBASE-8151).= =0A=0AWe could use this during scanning as well and avoid checking against = the readpoint altogether.=0A(might need some refactoring, though, have to c= hecked closer).=0A=0A=0A-- Lars=0A=0A=0A=0A----- Original Message -----=0AF= rom: lars hofhansl =0ATo: "dev@hbase.apache.org" =0ACc: =0ASent: Friday, October 11, 2013 6:28 PM=0ASubject: R= e: skipKVsNewerThanReadpoint in StoreFileScanner and MemStoreScanner=0A=0AI= nteresting. Never came up in my profiling of raw scan performance.=0AOf cou= rse my assumption was that the vast majority of all KVs are in HFiles and t= hus in the blockcache (not the memstore).=0A=0AThreadLocals are indeed expe= nsive, we ran into such problems as well (code unrelated to HBase, though).= =0A=0A=0AMind filing a jira, Vladimir? If there's a perf issue, we should f= ix it.=0A=0A=0A-- Lars=0A=0A________________________________=0A=0AFrom: Vla= dimir Rodionov =0ATo: "dev@hbase.apache.org" =0ASent: Friday, October 11, 2013 2:36 PM=0ASubject: Re: s= kipKVsNewerThanReadpoint in StoreFileScanner and MemStoreScanner=0A=0A=0AYe= s, threadLocal.get() is expensive when you count every nanosecond. There=0A= is no need to call it every time in MemStoreScanner.next().=0A=0A=0A=0AOn F= ri, Oct 11, 2013 at 2:32 PM, Ted Yu wrote:=0A=0A> Mul= tiVersionConsistencyControl.getThreadReadPoint() retrieves value from a=0A>= ThreadLocal.=0A>=0A> Can you specify which operation becomes expensive ?= =0A>=0A> BTW I only found IsolationLevel.READ_UNCOMMITTED=0A> in TestRowPro= cessorEndpoint. Looks like it is not normally used.=0A>=0A>=0A> On Fri, Oct= 11, 2013 at 2:20 PM, Vladimir Rodionov=0A> wrote:= =0A>=0A> > Update.=0A> >=0A> > This method is not called in MemStoreScanner= , but direct call to :=0A> >=0A> > readPoint =3D MultiVersionConsistencyCon= trol.getThreadReadPoint();=0A> >=0A> > on every next, seek etc=0A> > which = is basically the same.=0A> >=0A> > All these calls become very expensive wh= en you try to achieve 10s of=0A> > millions RPS in scan operations.=0A> >= =0A> > Best regards,=0A> > Vladimir Rodionov=0A> > Principal Platform Engin= eer=0A> > Carrier IQ, www.carrieriq.com=0A> > e-mail: vrodionov@carrieriq.c= om=0A> >=0A> > ________________________________________=0A> > From: Vladimi= r Rodionov=0A> > Sent: Friday, October 11, 2013 2:18 PM=0A> > To: dev@hbase= .apache.org=0A> > Subject: skipKVsNewerThanReadpoint in StoreFileScanner an= d=0A> MemStoreScanner=0A> >=0A> > From HRegion:=0A> >=0A> > synchronized(sc= annerReadPoints) {=0A> >=A0 =A0 =A0 =A0=A0=A0if (isolationLevel =3D=3D Isol= ationLevel.READ_UNCOMMITTED) {=0A> >=A0 =A0 =A0 =A0 =A0=A0=A0// This scan c= an read even uncommitted transactions=0A> >=A0 =A0 =A0 =A0 =A0=A0=A0this.re= adPt =3D Long.MAX_VALUE;=0A> >=A0 =A0 =A0 =A0 =A0=A0=A0MultiVersionConsiste= ncyControl.setThreadReadPoint(this.readPt);=0A> >=A0 =A0 =A0 =A0=A0=A0} els= e {=0A> >=A0 =A0 =A0 =A0 =A0=A0=A0this.readPt =3D=0A> > MultiVersionConsist= encyControl.resetThreadReadPoint(mvcc);=0A> >=A0 =A0 =A0 =A0=A0=A0}=0A> >= =0A> > If isolation level is READ_UNCOMMITTED than this method should never= be=0A> > called in both StoreFileScanner and MemStoreScanner=0A> > If isol= ation level is READ_COMMITTED than this method must be called only=0A> > in= MemStoreScanner, because HFiles are immutable no new KV's can be added=0A>= > to HFile after StoreFileScanner was created.=0A> >=0A> >=0A> > Correct?= =0A> >=0A> >=0A> > Best regards,=0A> > Vladimir Rodionov=0A> > Principal Pl= atform Engineer=0A> > Carrier IQ, www.carrieriq.com=0A> > e-mail: vrodionov= @carrieriq.com=0A> >=0A> > Confidentiality Notice:=A0 The information conta= ined in this message,=0A> > including any attachments hereto, may be confid= ential and is intended to=0A> be=0A> > read only by the individual or entit= y to whom this message is addressed.=0A> If=0A> > the reader of this messag= e is not the intended recipient or an agent or=0A> > designee of the intend= ed recipient, please note that any review, use,=0A> > disclosure or distrib= ution of this message or its attachments, in any=0A> form,=0A> > is strictl= y prohibited.=A0 If you have received this message in error,=0A> please=0A>= > immediately notify the sender and/or Notifications@carrieriq.com and=0A>= > delete or destroy any copy of this message and its attachments.=0A> >=0A= >