You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by mi...@apache.org on 2014/10/13 07:50:29 UTC

git commit: HBASE-12239 Document Hedged Reads

Repository: hbase
Updated Branches:
  refs/heads/master 8e9a8b002 -> 3ccfb2baa


HBASE-12239 Document Hedged Reads


Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/3ccfb2ba
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/3ccfb2ba
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/3ccfb2ba

Branch: refs/heads/master
Commit: 3ccfb2baadf8e600f92fefa9259d30441b28ed1d
Parents: 8e9a8b0
Author: Misty Stanley-Jones <ms...@cloudera.com>
Authored: Mon Oct 13 14:41:52 2014 +1000
Committer: Misty Stanley-Jones <ms...@cloudera.com>
Committed: Mon Oct 13 15:50:04 2014 +1000

----------------------------------------------------------------------
 src/main/docbkx/performance.xml | 52 ++++++++++++++++++++++++++++++++++++
 1 file changed, 52 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/3ccfb2ba/src/main/docbkx/performance.xml
----------------------------------------------------------------------
diff --git a/src/main/docbkx/performance.xml b/src/main/docbkx/performance.xml
index 59287ee..8a28d73 100644
--- a/src/main/docbkx/performance.xml
+++ b/src/main/docbkx/performance.xml
@@ -988,6 +988,58 @@ htable.close();
       </section>
     </section>
     <!--  bloom  -->
+    <section>
+      <title>Hedged Reads</title>
+      <para>Hedged reads are a feature of HDFS, introduced in <link
+          xlink:href="https://issues.apache.org/jira/browse/HDFS-5776">HDFS-5776</link>. Normally, a
+        single thread is spawned for each reqd request. However, if hedged reads are enabled, the
+        client waits some configurable amount of time, and if the read does not return, the client
+        spawns a second read request, against a different block replica of the same data. Whichever
+        read returns first is used, and the other read request is discarded. Hedged reads can be
+        helpful for times where a rare slow read is caused by a transient error such as a failing
+        disk or flaky network connection.</para>
+      <para> Because a HBase RegionServer is a HDFS client, you can enable hedged reads in HBase, by
+        adding the following properties to the RegionServer's hbase-site.xml and tuning the values
+        to suit your environment.</para>
+      <itemizedlist>
+        <title>Configuration for Hedged Reads</title>
+        <listitem>
+          <para><code>dfs.client.hedged.read.threadpool.size</code> - the number of threads
+            dedicated to servicing hedged reads. If this is set to 0 (the default), hedged reads are
+            disabled.</para>
+        </listitem>
+        <listitem>
+          <para><code>dfs.client.hedged.read.threshold.millis</code> - the number of milliseconds to
+            wait before spawning a second read thread.</para>
+        </listitem>
+      </itemizedlist>
+      <example>
+        <title>Hedged Reads Configuration Example</title>
+        <screen><![CDATA[<property>
+  <name>dfs.client.hedged.read.threadpool.size</name>
+  <value>20</value>  <!-- 20 threads -->
+</property>
+<property>
+  <name>dfs.client.hedged.read.threshold.millis</name>
+  <value>10</value>  <!-- 10 milliseconds -->
+</property>]]></screen>
+      </example>
+      <para>Use the following metrics to tune the settings for hedged reads on
+        your cluster. See <xref linkend="hbase_metrics"/>  for more information.</para>
+      <itemizedlist>
+        <title>Metrics for Hedged Reads</title>
+        <listitem>
+          <para>hedgedReadOps - the number of times hedged read threads have been triggered. This
+            could indicate that read requests are often slow, or that hedged reads are triggered too
+            quickly.</para>
+        </listitem>
+        <listitem>
+          <para>hedgeReadOpsWin - the number of times the hedged read thread was faster than the
+            original thread. This could indicate that a given RegionServer is having trouble
+            servicing requests.</para>
+        </listitem>
+      </itemizedlist>
+    </section>
 
   </section>
   <!--  reading -->