If you have been using HBase off-heap bucketcache, you may agree that configuration it is a bit cumbersome to say the least. In version 1.0, the HBase development team simplified the offheap cache configuration process. With the changes, the following are the steps to configure bucketCache for e.g. of size n GB.
Set the total off-heap memory size to be used by HBase to the environment variable HBASE_OFFHEAPSIZE. One way to do this is to set it in hbase-env.sh
1
export HBASE_OFFHEAPSIZE=(n+x)G
Note The “G” is for gigabytes. The value for x should be 1 to 2 GB and the value should be at the higher end for clusters handling high volume of transactions.
- The other option to configure the total off-heap memory size is tp set the -XX:MaxDirectMemorySize JVM property. Again this value can be set in hbase-env.sh
If you are wondering what x GB is for, it is for Java direct memory used by hdfs client used by hbase to interact with the underlying hdfs filesystem.
- Set the HBase property hbase.bucketcache.combinedcache.enabled to true so that on-heap cache will be used for index and bloomfilter blocks along with bucketcache for data blocks.