Configure the off-heap BucketCache using Cloudera Manager
You can configure the off-heap BucketCache engine using Cloudera Manager.
- Go to the HBase service.
- Click the Configuration tab.
-
Select the RegionServer scope and do the
following:
- Ensure that Enable Combined BucketCache is selected.
-
Set BucketCache IOEngine to
offheap
. - Update the value of BucketCache Size according to the required BucketCache size.
-
In the Region Server Environment Advanced Configuration Snippet
(Safety Valve), edit the
HBASE_REGIONSERVER_OPTS
parameter: Add the JVM option$HBASE_REGIONSERVER_OPTS -XX:MaxDirectMemorySize=<size>G
, replacing<size>
with a value not smaller than the aggregated heap size expressed as a number of gigabytes + the off-heap BucketCache, expressed as a number of gigabytes + around 1GB used for HDFS short circuit read. For example, if the off-heap BucketCache is 16GB and the heap size is 15GB, the total value of MaxDirectMemorySize could be 32:-XX:MaxDirectMamorySize=32G
HBASE_REGIONSERVER_OPTS="$HBASE_REGIONSERVER_OPTS -XX:MaxDirectMemorySize=<size>G"
-
Optionally, when combined BucketCache is in use, you can decrease the heap size
ratio allocated to the L1 BlockCache, and increase the Memstore size. The
on-heap BlockCache only stores indexes and Bloom filters, the actual data
resides in the off-heap BucketCache. A larger Memstore is able to accommodate
more write request before flushing them to disks.
- Decrease HFile Block Cache Size to
0.3
or0.2
. - Increase Maximum Size of All Memstores in
RegionServer to
0.5
or0.6
respectively.
- Decrease HFile Block Cache Size to
- Enter a Reason for change, and then click Save Changes to commit the changes.
- Restart or rolling restart your RegionServers for the changes to take effect.