Yang, Tong 6182f91ba8 MRS component operation guide_normal 2.0.38.SP20 version
Reviewed-by: Hasko, Vladimir <vladimir.hasko@t-systems.com>
Co-authored-by: Yang, Tong <yangtong2@huawei.com>
Co-committed-by: Yang, Tong <yangtong2@huawei.com>
2022-12-09 14:55:21 +00:00

138 lines
18 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<a name="mrs_01_1016"></a><a name="mrs_01_1016"></a>
<h1 class="topictitle1">Optimizing Put and Scan Performance</h1>
<div id="body1590128863840"><div class="section" id="mrs_01_1016__s01cbaaba52c74e3e8e8ae2f8865c5d48"><h4 class="sectiontitle">Scenario</h4><p id="mrs_01_1016__add2a10b2d841405fb14d1ca24db6c927">HBase has many configuration parameters related to read and write performance. The configuration parameters need to be adjusted based on the read/write request loads. This section describes how to optimize read and write performance by modifying the RegionServer configurations.</p>
<div class="note" id="mrs_01_1016__note3659121463219"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><p id="mrs_01_1016__p136601141326">This section applies to MRS 3.<em id="mrs_01_1016__i10688851183418">x</em> and later versions.</p>
</div></div>
</div>
<div class="section" id="mrs_01_1016__s791bed07f8ba44bb82fc935de063d0f8"><h4 class="sectiontitle">Procedure</h4><ul id="mrs_01_1016__u75b98520bec44fbca64ff00027c643c9"><li id="mrs_01_1016__l1ec3314c2b0b4bdf8bfe9859e34e0d3f">JVM GC parameters<p id="mrs_01_1016__a56ef94372ba5400fa02bf2e9ebbce23f"><a name="mrs_01_1016__l1ec3314c2b0b4bdf8bfe9859e34e0d3f"></a><a name="l1ec3314c2b0b4bdf8bfe9859e34e0d3f"></a>Suggestions on setting the RegionServer <strong id="mrs_01_1016__b543125213524">GC_OPTS</strong> parameter:</p>
<ul id="mrs_01_1016__uc8632e55ae474485827d99e6ffa64070"><li id="mrs_01_1016__l4b1433aef43f41c1963fe418b68cee2a">Set <strong id="mrs_01_1016__b12627193913196">-Xms</strong> and <strong id="mrs_01_1016__b22856462197">-Xmx</strong> to the same value based on your needs. Increasing the memory can improve the read and write performance. For details, see the description of <span class="parmname" id="mrs_01_1016__pa3bbacd301814c95ab1a6137964fdcb8"><b>hfile.block.cache.size</b></span> in <a href="#mrs_01_1016__tcd04a4cfd9f94a80a47de3ccb824175e">Table 2</a> and <span class="parmname" id="mrs_01_1016__p80d2b150ddc84c08a48f4e6bc8d2c01b"><b>hbase.regionserver.global.memstore.size</b></span> in <a href="#mrs_01_1016__t5194159aa9d34637bba4cdd0aa3b925e">Table 1</a>.</li><li id="mrs_01_1016__le82eb8249dd848c080e7d6686d8a91be">Set <strong id="mrs_01_1016__b20157530172119">-XX:NewSize</strong> and <strong id="mrs_01_1016__b2453103411219">-XX:MaxNewSize</strong> to the same value. You are advised to set the value to <span class="parmvalue" id="mrs_01_1016__p7158ff695134478da0971f0645cc8b4a"><b>512M</b></span> in low-load scenarios and <span class="parmvalue" id="mrs_01_1016__pd4b608bf27884f499c6ba5c7085a10a1"><b>2048M</b></span> in high-load scenarios.</li><li id="mrs_01_1016__l9abb296cb8dd401a914066bfe8c6b6a7">Set <strong id="mrs_01_1016__b239712732219">X-XX:CMSInitiatingOccupancyFraction</strong> to be less than and equal to 90, and it is calculated as follows: <span class="parmvalue" id="mrs_01_1016__pae9f0ff16ad5497eb3cd21fc27356b47"><b>100 x (hfile.block.cache.size + hbase.regionserver.global.memstore.size + 0.05)</b></span>.</li><li id="mrs_01_1016__l251db2fd119c4ac5b031df65824ab34e"><strong id="mrs_01_1016__b142401015152319">-XX:MaxDirectMemorySize</strong> indicates the non-heap memory used by the JVM. You are advised to set this parameter to <span class="parmvalue" id="mrs_01_1016__pc9deb46c6c2944039abe88181e3a5943"><b>512M</b></span> in low-load scenarios and <span class="parmvalue" id="mrs_01_1016__p5173147a62b94f989940f2fa115a636e"><b>2048M</b></span> in high-load scenarios.<div class="note" id="mrs_01_1016__note53166321445"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><p id="mrs_01_1016__p7316332740">The <strong id="mrs_01_1016__b1577112416314">-XX:MaxDirectMemorySize</strong> parameter is not used by default. If you need to set this parameter, add it to the <strong id="mrs_01_1016__b120913361318">GC_OPTS</strong> parameter.</p>
</div></div>
</li></ul>
</li><li id="mrs_01_1016__l43fa75c3ea6f4e0c91ca178e763e26ff">Put parameters<p id="mrs_01_1016__ac6376f5299e140cfb8ac6ba46f972dfb"><a name="mrs_01_1016__l43fa75c3ea6f4e0c91ca178e763e26ff"></a><a name="l43fa75c3ea6f4e0c91ca178e763e26ff"></a>RegionServer processes the data of the put request and writes the data to memstore and HLog.</p>
<ul id="mrs_01_1016__u21c2cccb836a42378b423243339f9625"><li id="mrs_01_1016__lc594a78de1c9405799c8bd1250130512">When the size of memstore reaches the value of <strong id="mrs_01_1016__b1469463073215">hbase.hregion.memstore.flush.size</strong>, memstore is updated to HDFS to generate HFiles.</li><li id="mrs_01_1016__l5e12b8ffc1014daeade5e656a5036cc1">Compaction is triggered when the number of HFiles in the column cluster of the current region reaches the value of <strong id="mrs_01_1016__b882413139335">hbase.hstore.compaction.min</strong>.</li><li id="mrs_01_1016__l6888c669858041508af7f30a5aaa8954">If the number of HFiles in the column cluster of the current region reaches the value of <strong id="mrs_01_1016__b73441345183318">hbase.hstore.blockingStoreFiles</strong>, the operation of refreshing the memstore and generating HFiles is blocked. As a result, the put request is blocked.</li></ul>
<div class="tablenoborder"><a name="mrs_01_1016__t5194159aa9d34637bba4cdd0aa3b925e"></a><a name="t5194159aa9d34637bba4cdd0aa3b925e"></a><table cellpadding="4" cellspacing="0" summary="" id="mrs_01_1016__t5194159aa9d34637bba4cdd0aa3b925e" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Put parameters</caption><thead align="left"><tr id="mrs_01_1016__r33e2279720804d899aefd7358dea8168"><th align="left" class="cellrowborder" valign="top" width="36.01%" id="mcps1.3.2.2.2.3.2.4.1.1"><p id="mrs_01_1016__aa99e068c0f4044119409a260c47cf3a3"><strong id="mrs_01_1016__a435169c99d9b40c8922cd553f384ebc0">Parameter</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="40.910000000000004%" id="mcps1.3.2.2.2.3.2.4.1.2"><p id="mrs_01_1016__a432d9dbf9cc948b3984a3ad74bc8b5df"><strong id="mrs_01_1016__a243a0d05ee3b4216aedc08bbc44f09d1">Description</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="23.080000000000002%" id="mcps1.3.2.2.2.3.2.4.1.3"><p id="mrs_01_1016__a560ba539815a4934a22f96c82c0599ed"><strong id="mrs_01_1016__a7ffa0beba70c4cfa81138867eddddf62">Default Value</strong></p>
</th>
</tr>
</thead>
<tbody><tr id="mrs_01_1016__r1f5ac5dd7eba406bab7ba0bd1447289d"><td class="cellrowborder" valign="top" width="36.01%" headers="mcps1.3.2.2.2.3.2.4.1.1 "><p id="mrs_01_1016__a29122d6ce31a43be91286e551fba13fa">hbase.wal.hsync</p>
</td>
<td class="cellrowborder" valign="top" width="40.910000000000004%" headers="mcps1.3.2.2.2.3.2.4.1.2 "><p id="mrs_01_1016__a2d43a193efc7477390758860bce8165d">Indicates whether each WAL is persistent to disks.</p>
<p id="mrs_01_1016__af568fafb23df437c9224b074d930b316">For details, see <a href="mrs_01_1637.html">Improving Put Performance</a>.</p>
</td>
<td class="cellrowborder" valign="top" width="23.080000000000002%" headers="mcps1.3.2.2.2.3.2.4.1.3 "><p id="mrs_01_1016__a929d321235014e1fa9ddb536248d9774">true</p>
</td>
</tr>
<tr id="mrs_01_1016__re07840c9160c4019aac121172c076eb8"><td class="cellrowborder" valign="top" width="36.01%" headers="mcps1.3.2.2.2.3.2.4.1.1 "><p id="mrs_01_1016__a16f1184ce657494db29daad4f8ca6b04">hbase.hfile.hsync</p>
</td>
<td class="cellrowborder" valign="top" width="40.910000000000004%" headers="mcps1.3.2.2.2.3.2.4.1.2 "><p id="mrs_01_1016__aa3a1984cd0934af1ad3bda63ec0ec802">Indicates whether HFile write operations are persistent to disks.</p>
<p id="mrs_01_1016__aecfdc801c1504d89ae86bd1cb64eec9b">For details, see <a href="mrs_01_1637.html">Improving Put Performance</a>.</p>
</td>
<td class="cellrowborder" valign="top" width="23.080000000000002%" headers="mcps1.3.2.2.2.3.2.4.1.3 "><p id="mrs_01_1016__aa7de7ec018b24fcfa301995828325a17">true</p>
</td>
</tr>
<tr id="mrs_01_1016__r345573f3da6f4295a807300d433b5c2e"><td class="cellrowborder" valign="top" width="36.01%" headers="mcps1.3.2.2.2.3.2.4.1.1 "><p id="mrs_01_1016__ab5187978928447a9be56dee2885ec19f"><span id="mrs_01_1016__pc876a1cd0afe4d43997b8aeffb2e721b">hbase.hregion.memstore.flush.size</span></p>
</td>
<td class="cellrowborder" valign="top" width="40.910000000000004%" headers="mcps1.3.2.2.2.3.2.4.1.2 "><p id="mrs_01_1016__p1911713718566">If the size of MemStore (unit: Byte) exceeds a specified value, MemStore is flushed to the corresponding disk. The value of this parameter is checked by each thread running <strong id="mrs_01_1016__b1440410251230">hbase.server.thread.wakefrequency</strong>. <span id="mrs_01_1016__ph196928346454710">It is recommended that you set this parameter to an integer multiple of the HDFS block size. You can increase the value if the memory is sufficient and the put load is heavy.</span></p>
</td>
<td class="cellrowborder" valign="top" width="23.080000000000002%" headers="mcps1.3.2.2.2.3.2.4.1.3 "><p id="mrs_01_1016__a1ea761bb6f224c4a9b6b4737ca196e54"><span id="mrs_01_1016__pf0afc7c9ddc844babaa0dda5b80623c8">134217728</span></p>
</td>
</tr>
<tr id="mrs_01_1016__r0063512543004e2cb12123d0e7d34e54"><td class="cellrowborder" valign="top" width="36.01%" headers="mcps1.3.2.2.2.3.2.4.1.1 "><p id="mrs_01_1016__a509c44dcea0b48018f5cd79c16fc5a29"><span id="mrs_01_1016__pf63ace0a4fb54097a70297e8f151f313">hbase.regionserver.global.memstore.size</span></p>
</td>
<td class="cellrowborder" valign="top" width="40.910000000000004%" headers="mcps1.3.2.2.2.3.2.4.1.2 "><p id="mrs_01_1016__a75d5eee892374c168502d989253a55cc">Updates the size of all MemStores supported by the RegionServer before locking or forcible flush. It is recommended that you set this parameter to <span class="parmvalue" id="mrs_01_1016__p951f2bb3e64446cca878a6496095ea29"><b>hbase.hregion.memstore.flush.size x Number of regions with active writes/RegionServer GC -Xmx</b></span>. The default value is <strong id="mrs_01_1016__b842352706215330">0.4</strong>, indicating that 40% of RegionServer GC -Xmx is used.</p>
</td>
<td class="cellrowborder" valign="top" width="23.080000000000002%" headers="mcps1.3.2.2.2.3.2.4.1.3 "><p id="mrs_01_1016__af86698b768634d0392f9ec0834d25cf7">0.4</p>
</td>
</tr>
<tr id="mrs_01_1016__r501298bba8194402a1f27bdcbdba1caf"><td class="cellrowborder" valign="top" width="36.01%" headers="mcps1.3.2.2.2.3.2.4.1.1 "><p id="mrs_01_1016__a0578e0def1c44701bcbba011008f9ae9"><span id="mrs_01_1016__p4d0db121b79c4a23a493b385f40ea540">hbase.hstore.flusher.count</span></p>
</td>
<td class="cellrowborder" valign="top" width="40.910000000000004%" headers="mcps1.3.2.2.2.3.2.4.1.2 "><p id="mrs_01_1016__a12b0e835d78941d2860db8c2d0fcb95d">Indicates the number of memstore flush threads. You can increase the parameter value in heavy-put-load scenarios.</p>
</td>
<td class="cellrowborder" valign="top" width="23.080000000000002%" headers="mcps1.3.2.2.2.3.2.4.1.3 "><p id="mrs_01_1016__a701c8d93dc1b41109438ac00d65480a3"><span id="mrs_01_1016__p061e766d65f0485e8dbd86c44995928c">2</span></p>
</td>
</tr>
<tr id="mrs_01_1016__r429248e7c4534cbbb315d47d3af70f3c"><td class="cellrowborder" valign="top" width="36.01%" headers="mcps1.3.2.2.2.3.2.4.1.1 "><p id="mrs_01_1016__afe785cef525f4d7e8e745c541e531bf9"><span id="mrs_01_1016__p77632cb6081840079409ece8dfec958f">hbase.regionserver.thread.compaction.small</span></p>
</td>
<td class="cellrowborder" valign="top" width="40.910000000000004%" headers="mcps1.3.2.2.2.3.2.4.1.2 "><p id="mrs_01_1016__aec26a70d72054fc7bb8a4a75fc3f2778">Indicates the number of small compaction threads. You can increase the parameter value in heavy-put-load scenarios.</p>
</td>
<td class="cellrowborder" valign="top" width="23.080000000000002%" headers="mcps1.3.2.2.2.3.2.4.1.3 "><p id="mrs_01_1016__a6ccc16fe539449bb8da19beedc9f0006"><span id="mrs_01_1016__pbcbe8f6191b04d08bbafa9da357e78e2">1</span>0</p>
</td>
</tr>
<tr id="mrs_01_1016__r7cb5b5cf52184077b653a5a6d4a6e549"><td class="cellrowborder" valign="top" width="36.01%" headers="mcps1.3.2.2.2.3.2.4.1.1 "><p id="mrs_01_1016__a7014a9f43c094f5082e47e2ed6f50466"><span id="mrs_01_1016__p33e0b146dbbb45c59ed3231bc04a99fc">hbase.hstore.blockingStoreFiles</span></p>
</td>
<td class="cellrowborder" valign="top" width="40.910000000000004%" headers="mcps1.3.2.2.2.3.2.4.1.2 "><p id="mrs_01_1016__p9810122717590">If the number of HStoreFile files in a Store exceeds the specified value, the update of the HRegion will be locked until a compression is completed or the value of <strong id="mrs_01_1016__b142618739454710">base.hstore.blockingWaitTime</strong> is exceeded. Each time MemStore is flushed, a StoreFile file is written into MemStore. Set this parameter to a larger value in heavy-put-load scenarios.</p>
</td>
<td class="cellrowborder" valign="top" width="23.080000000000002%" headers="mcps1.3.2.2.2.3.2.4.1.3 "><p id="mrs_01_1016__a64b4586095c3422dbafb567043f85404"><span id="mrs_01_1016__padfdb84034a349bab73fb1a310bb3e87">1</span>5</p>
</td>
</tr>
</tbody>
</table>
</div>
</li><li id="mrs_01_1016__l9e205994a6164300bbbb557570c064de">Scan parameters
<div class="tablenoborder"><a name="mrs_01_1016__tcd04a4cfd9f94a80a47de3ccb824175e"></a><a name="tcd04a4cfd9f94a80a47de3ccb824175e"></a><table cellpadding="4" cellspacing="0" summary="" id="mrs_01_1016__tcd04a4cfd9f94a80a47de3ccb824175e" frame="border" border="1" rules="all"><caption><b>Table 2 </b>Scan parameters</caption><thead align="left"><tr id="mrs_01_1016__r8e84be06c88b47c5b099dd4c72e876ac"><th align="left" class="cellrowborder" valign="top" width="36.15%" id="mcps1.3.2.2.3.1.2.4.1.1"><p id="mrs_01_1016__a46439580e63146c1998915d2dc210b79"><strong id="mrs_01_1016__aa367d757f17c4c08be466c203d02ad75">Parameter</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="40.77%" id="mcps1.3.2.2.3.1.2.4.1.2"><p id="mrs_01_1016__af976b507096d4d419b96f4b16a24ce4e"><strong id="mrs_01_1016__aca881a8995404702ba5596cd24968a92">Description</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="23.080000000000002%" id="mcps1.3.2.2.3.1.2.4.1.3"><p id="mrs_01_1016__a9ab207c2965042d08bf4401372431d9b"><strong id="mrs_01_1016__a9631359af02041998a5c7cab6907726d">Default Value</strong></p>
</th>
</tr>
</thead>
<tbody><tr id="mrs_01_1016__ra54ff0058e674c65a6fb4906627a4b87"><td class="cellrowborder" valign="top" width="36.15%" headers="mcps1.3.2.2.3.1.2.4.1.1 "><p id="mrs_01_1016__a540a09f709d84c09ae67032b5aa01c22">hbase.client.scanner.timeout.period</p>
</td>
<td class="cellrowborder" valign="top" width="40.77%" headers="mcps1.3.2.2.3.1.2.4.1.2 "><p id="mrs_01_1016__p1778110816010">Client and RegionServer parameters, indicating the lease timeout period of the client executing the scan operation. You are advised to set this parameter to an integer multiple of 60000 ms. You can set this parameter to a larger value when the read load is heavy. The unit is milliseconds.</p>
</td>
<td class="cellrowborder" valign="top" width="23.080000000000002%" headers="mcps1.3.2.2.3.1.2.4.1.3 "><p id="mrs_01_1016__abd9bf58d739c437ab967656c753d1755">60000</p>
</td>
</tr>
<tr id="mrs_01_1016__ra8e4c60d26624629aa3b0f8c90b5f0e1"><td class="cellrowborder" valign="top" width="36.15%" headers="mcps1.3.2.2.3.1.2.4.1.1 "><p id="mrs_01_1016__abdbd8e09b2a940fea3d80c9a44c0528e">hfile.block.cache.size</p>
</td>
<td class="cellrowborder" valign="top" width="40.77%" headers="mcps1.3.2.2.3.1.2.4.1.2 "><p id="mrs_01_1016__a3171ac7914a549f1a06dff76954252ab">Indicates the data cache percentage in the RegionServer GC Xmx. You can increase the parameter value in heavy-read-load scenarios, in order to improve cache hit ratio and performance. It indicates the percentage of the maximum heap (-Xmx setting) allocated to the block cache of HFiles or StoreFiles.</p>
</td>
<td class="cellrowborder" valign="top" width="23.080000000000002%" headers="mcps1.3.2.2.3.1.2.4.1.3 "><p id="mrs_01_1016__a8ce85521c3d54e82924ca436b3551867">When offheap is disabled, the default value is <strong id="mrs_01_1016__b0896131544615">0.25</strong>. When offheap is enabled, the default value is <strong id="mrs_01_1016__b444492219460">0.1</strong>.</p>
</td>
</tr>
</tbody>
</table>
</div>
</li><li id="mrs_01_1016__l081503faa2ad4165b9b920080d1a1492">Handler parameters
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="mrs_01_1016__t3eb8edf1145a41fba495166fc07ed411" frame="border" border="1" rules="all"><caption><b>Table 3 </b>Handler parameters</caption><thead align="left"><tr id="mrs_01_1016__r11c6c695f77a45489197a8f0c3c3b083"><th align="left" class="cellrowborder" valign="top" width="36.15%" id="mcps1.3.2.2.4.1.2.4.1.1"><p id="mrs_01_1016__a9168176a731c4df48ad5018f12dc91f8"><strong id="mrs_01_1016__acf4cb782cfa6455f9f58df4c78e6c911">Parameter</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="40.77%" id="mcps1.3.2.2.4.1.2.4.1.2"><p id="mrs_01_1016__a805f220b567b4790bac9c361a208c9d7"><strong id="mrs_01_1016__a6b53f92e9e9d41aebe32c763752a4034">Description</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="23.080000000000002%" id="mcps1.3.2.2.4.1.2.4.1.3"><p id="mrs_01_1016__a994ababcd54f48f69ae27e0f74aa19c7"><strong id="mrs_01_1016__ac2f00d8aeebb4e6694c27b0c8436186e">Default Value</strong></p>
</th>
</tr>
</thead>
<tbody><tr id="mrs_01_1016__r1f5ab89340b9462bb09c486376669553"><td class="cellrowborder" valign="top" width="36.15%" headers="mcps1.3.2.2.4.1.2.4.1.1 "><p id="mrs_01_1016__a3f6a478335144b969fa3d5c9d337ffe2">hbase.regionserver.handler.count</p>
</td>
<td class="cellrowborder" valign="top" width="40.77%" headers="mcps1.3.2.2.4.1.2.4.1.2 "><p id="mrs_01_1016__a3f695a9868324a3e896e9d1fe07e0616">Indicates the number of RPC server instances on RegionServer. The recommended value ranges from 200 to 400.</p>
</td>
<td class="cellrowborder" valign="top" width="23.080000000000002%" headers="mcps1.3.2.2.4.1.2.4.1.3 "><p id="mrs_01_1016__a8a54ce3ca3324e1dbdd1a69268d879b5">200</p>
</td>
</tr>
<tr id="mrs_01_1016__rb1030b854d364d43bccc5da9a5c22d27"><td class="cellrowborder" valign="top" width="36.15%" headers="mcps1.3.2.2.4.1.2.4.1.1 "><p id="mrs_01_1016__ae48b6460ca1b48d59f6237d29827f70b">hbase.regionserver.metahandler.count</p>
</td>
<td class="cellrowborder" valign="top" width="40.77%" headers="mcps1.3.2.2.4.1.2.4.1.2 "><p id="mrs_01_1016__a0c1b699aec764393a2ae9aa9ee3156cb">Indicates the number of program instances for processing prioritized requests. The recommended value ranges from 200 to 400.</p>
</td>
<td class="cellrowborder" valign="top" width="23.080000000000002%" headers="mcps1.3.2.2.4.1.2.4.1.3 "><p id="mrs_01_1016__ad3c65f9d76774bf0ad791940d8129931">200</p>
</td>
</tr>
</tbody>
</table>
</div>
</li></ul>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="mrs_01_1013.html">HBase Performance Tuning</a></div>
</div>
</div>