Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id CFD6B200BBD for ; Tue, 8 Nov 2016 19:33:00 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id CE7DB160AD0; Tue, 8 Nov 2016 18:33:00 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 20F0B160B0A for ; Tue, 8 Nov 2016 19:32:59 +0100 (CET) Received: (qmail 74540 invoked by uid 500); 8 Nov 2016 18:32:59 -0000 Mailing-List: contact issues-help@hbase.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list issues@hbase.apache.org Received: (qmail 74470 invoked by uid 99); 8 Nov 2016 18:32:59 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 08 Nov 2016 18:32:59 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id DEE2A2C2A67 for ; Tue, 8 Nov 2016 18:32:58 +0000 (UTC) Date: Tue, 8 Nov 2016 18:32:58 +0000 (UTC) From: "stack (JIRA)" To: issues@hbase.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (HBASE-15788) Use Offheap ByteBuffers from BufferPool to read RPC requests. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Tue, 08 Nov 2016 18:33:01 -0000 [ https://issues.apache.org/jira/browse/HBASE-15788?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15648380#comment-15648380 ] stack commented on HBASE-15788: ------------------------------- Dang. Looking more. So... 45 /** 46 * Writes an int to the underlying output stream as four 47 * bytes, high byte first. 48 * @param i the int to write 49 * @throws IOException if an I/O error occurs. 50 */ 51 void writeInt(int i) throws IOException; is an optimization that has nought to do w/ ByteBuffer writing? On commit fix this comment: 26 * This interface marks 27 * Interface adds support for writing {@link ByteBuffer} into OutputStream. There is no OS involved... it is just something that can write from a ByteBuffer... Yeah, remove OS mentions elsehwere in the class too.. Is ByteBufferWriterWrapper a Wrapper or is it an OS? One that implements BBWriter? If latter, should it be BBWriterOS? Sorry for messing w/ namings. Trying to make it clear to those who come along after us. > Use Offheap ByteBuffers from BufferPool to read RPC requests. > ------------------------------------------------------------- > > Key: HBASE-15788 > URL: https://issues.apache.org/jira/browse/HBASE-15788 > Project: HBase > Issue Type: Sub-task > Components: regionserver > Reporter: ramkrishna.s.vasudevan > Assignee: Anoop Sam John > Fix For: 2.0.0 > > Attachments: HBASE-15788.patch, HBASE-15788_V4.patch, HBASE-15788_V5.patch, HBASE-15788_V6.patch > > > Right now, when an RPC request reaches RpcServer, we read the request into an on demand created byte[]. When it is write request and including many mutations, the request size will be some what larger and we end up creating many temp on heap byte[] and causing more GCs. > We have a ByteBufferPool of fixed sized off heap BBs. This is used at RpcServer while sending read response only. We can make use of the same while reading reqs also. Instead of reading whole of the request bytes into a single BB, we can read into N BBs (based on the req size). When BB is not available from pool, we will fall back to old way of on demand on heap byte[] creation. > Remember these are off heap BBs. We read many proto objects from this read request bytes (like header, Mutation protos etc). Thanks to PB 3 and our shading work as it supports off heap BB now. Also the payload cells are also in these DBBs now. The codec decoder can work on these and create off heap BBs. Whole of our write path work with Cells now. At the time of addition to memstore, these cells are by default copied to MSLAB ( off heap based pooled MSLAB issue to follow this one). If MSLAB copy is not possible, we will do a copy to on heap byte[]. > One possible down side of this is : > Before adding to Memstore, we do write to WAL. So the Cells created out of the offheap BBs (Codec#Decoder) will be used to write to WAL. The default FSHLog works with an OS obtained from DFSClient. This will have only standard OS write APIs which is byte[] based. So just to write to WAL, we will end up in temp on heap copy for each of the Cell. The other WAL imp (ie. AsynWAL) supports writing offheap Cells directly. We have work in progress to make AsycnWAL as default. Also we can raise HDFS req to support BB based write APIs in their client OS? Until then, will try for a temp workaround solution. Patch to say more on this. -- This message was sent by Atlassian JIRA (v6.3.4#6332)