Return-Path: X-Original-To: apmail-hbase-user-archive@www.apache.org Delivered-To: apmail-hbase-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 84E7810130 for ; Tue, 29 Apr 2014 00:57:28 +0000 (UTC) Received: (qmail 5257 invoked by uid 500); 29 Apr 2014 00:57:25 -0000 Delivered-To: apmail-hbase-user-archive@hbase.apache.org Received: (qmail 5148 invoked by uid 500); 29 Apr 2014 00:57:24 -0000 Mailing-List: contact user-help@hbase.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@hbase.apache.org Delivered-To: mailing list user@hbase.apache.org Received: (qmail 5139 invoked by uid 99); 29 Apr 2014 00:57:24 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 29 Apr 2014 00:57:24 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy includes SPF record at spf.trusted-forwarder.org) Received: from [209.85.128.174] (HELO mail-ve0-f174.google.com) (209.85.128.174) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 29 Apr 2014 00:57:20 +0000 Received: by mail-ve0-f174.google.com with SMTP id oz11so8979268veb.33 for ; Mon, 28 Apr 2014 17:56:57 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:content-type; bh=oSgNKHXppB0IhZn5xqBexY3D4s960I2+k4Nvp0OyTi4=; b=lnvjYMMWxaftoLcSfwFTNyG5PvlXhWDdNythcQp4hPO8bwvWdALsd/a3fWtc1bd0SC XwAVOuZkBEbuhGGQjP1h3VtkHqGTJYMIHph2rHU++HcDwJzaRpVeOd7fAJG2yR8UneJq O5g4FeM0HPangMokz5WvO4/Q8cFGAlsj5vVMx7ogiVAXzvzBg1JjhcTzAFMdf+ptAuEy WQNkC6stoWGbsl+GkNo4bDKprknzAAlRcBE+8WLC42pHyV9i/qesJ2tn+a0oG6RlfUW9 0DGooBmJqUeyXQDKY3b2SzJloY3t28B9yTD7NHI6SHvQwjy84fn/QUoGfoepvw7lr6et Igmw== X-Gm-Message-State: ALoCoQnsLTWZlE0eDgbfgGG3I4+M1dXF2nOhlPI5X+aP1sJxo4U36h1EofM5kfMZH52KmPIu4rSL X-Received: by 10.220.147.16 with SMTP id j16mr26560920vcv.14.1398733017524; Mon, 28 Apr 2014 17:56:57 -0700 (PDT) MIME-Version: 1.0 Received: by 10.52.116.172 with HTTP; Mon, 28 Apr 2014 17:56:36 -0700 (PDT) In-Reply-To: References: From: Jean-Marc Spaggiari Date: Mon, 28 Apr 2014 20:56:36 -0400 Message-ID: Subject: Re: question about threads count To: user Content-Type: multipart/alternative; boundary=047d7b3436d2a59c6404f823e81a X-Virus-Checked: Checked by ClamAV on apache.org --047d7b3436d2a59c6404f823e81a Content-Type: text/plain; charset=UTF-8 Why do you want to make sure the row is only inserted once? If you insert the same raw twice the 2nd one will simple overwrite the first one and HBase will take care of the versions. regarding the codes fragments, I don't think the autoflush is going to do a big difference compared to the cost of the check & put... 2014-04-28 20:50 GMT-04:00 Li Li : > I must use checkAndPut to ensure a row is only inserted once. > if I have 1000 checkAndPut,will setAutoFlush(false) useful? > is there any performance difference of the following two code fragments? > 1. > table.setAutoFlush(false); > for(int i=0;i<1000;i++){ > Put put=... > table.checkAndPut(,....put); > } > 2. > table.setAutoFlush(true); > for(int i=0;i<1000;i++){ > Put put=... > table.checkAndPut(,....put); > } > > On Tue, Apr 29, 2014 at 8:36 AM, Jean-Marc Spaggiari > wrote: > > It depends. Batch a list of puts/gets wll be way faster than checkAndPut, > > but the result will not be the same... a batch of puts will not do any > > check... > > > > > > 2014-04-28 20:17 GMT-04:00 Li Li : > > > >> but I have many checkAndPut operations. > >> will use batch a better solution? > >> > >> On Mon, Apr 28, 2014 at 8:01 PM, Jean-Marc Spaggiari > >> wrote: > >> > Hi Li Li, > >> > > >> > Yes, threads will impact the performances. If you send all you writes > >> with > >> > a single thread, a single HBase handler will take care of them, etc. > >> HBase > >> > does not provide a single handler for a single client connexion. It's > >> able > >> > to handle multiple threads and clients. > >> > > >> > However, it also all depends on the way you send your writes. If you > >> send a > >> > single puts(<10000>) per seconds, if will not be better to send 10 000 > >> > threads with a single put. > >> > > >> > I will recommend you to run some perf tests on your installation to > find > >> a > >> > good number for your configuration. > >> > > >> > JM > >> > > >> > > >> > 2014-04-28 6:27 GMT-04:00 Li Li : > >> > > >> >> hi all, > >> >> with the same read/write data, will threads count affect > performance? > >> >> e.g. I have 10,000 write request/second. I don't care the order > very > >> >> much. > >> >> how many writer threads should I use to obtain maximum throughput? > >> >> > >> > --047d7b3436d2a59c6404f823e81a--