Configure the off-heap BucketCache using Cloudera Manager

You can configure the off-heap BucketCache engine using Cloudera Manager.

  1. Go to the HBase service.
  2. Click the Configuration tab.
  3. Select the RegionServer scope and do the following:
    1. Ensure that Enable Combined BucketCache is selected.
    2. Set BucketCache IOEngine to offheap.
    3. Update the value of BucketCache Size according to the required BucketCache size.
  4. 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
  5. 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 or 0.2.
    • Increase Maximum Size of All Memstores in RegionServer to 0.5 or 0.6 respectively.
  6. Enter a Reason for change, and then click Save Changes to commit the changes.
  7. Restart or rolling restart your RegionServers for the changes to take effect.