Database Reference
In-Depth Information
Depending on the duration of data present in memory, it resides in different
locations in the Java heap, for example, data staying for shorter duration usually
stays in the young generation (also called new generation) of the heap. However,
when the data stays for a longer duration, it is promoted to the old generation
heap from the young generation heap. In JVM, the young generation heap space
is conigured from 128 MB to 512 MB, whereas the old generation heap holds the
remaining available heap, which can be GBs.
Hence, coniguring both young generation and old generation heap space is very
important. The young generation heap should be large enough so that it can hold
the objects and the old generation heap can avoid the frequent fragmentation. Wrong
coniguration of heap spaces can affect the latency of RegionServers as a result of GC
pauses. The following are a few of the commands that can use used to ine tune the
GC and Heap setting.
• Conigure the heap size by editing the hbase-env.sh ile. For example,
the following code snippet conigures a 5000 MB heap size for HBase:
$ vi $HBASE_HOME/conf/hbase-env.sh
export HBASE_HEAPSIZE=5000
• Add the following code to start the Concurrent-Mark-Sweep GC ( CMS )
earlier than the default:
$ vi $HBASE_HOME/conf/hbase-env.sh
export HBASE_OPTS= "$HBASE_OPTS -XX:CMSInitiatingOccupancyFracti
on=50"
Once this setting is applied across the nodes, restart the HBase cluster. For further
investigation, GC logging can also be enabled using the following command:
$ vi $HBASE_HOME/conf/hbase-env.sh
export HBASE_OPTS="$HBASE_OPTS -verbose:gc -XX:+PrintGCDetails
-XX:+PrintGCTimeStamps -Xloggc:/usr/local/hbase/logs/gc-hbase.log"
Other recommendations
Other than the previously discussed ways of performance tuning, the HBase cluster
should be ine-tuned using a different kind of coniguration for different types
of use cases or workloads such as:
 
Search WWH ::




Custom Search