Optimize the hbaseJVMGC parameter to avoid ZooKeeper session overhead caused by JVM memory reclaim.

Source: Internet
Author: User
The default memory size of hbase is 1 GB. The official documents clearly state that this is unable to support long-time normal operation, and it must trigger a ZooKeeper Session Timeout event, resulting in service exit. The document provides four suggestions that are not very useful: Increase the memory size (but do not tell how much to add, the more it is, the better) and ensure that swap partitions are not used (but my hard disk is SSD ).

The default memory size of hbase is 1 GB. The official documents clearly state that this is unable to support long-time normal operation, and it must trigger a ZooKeeper Session Timeout event, resulting in service exit. The document provides four suggestions that are not very useful: Increase the memory size (but do not tell how much to add, the more it is, the better) and ensure that swap partitions are not used (but my hard disk is SSD ).

The default memory size of hbase is 1 GB. The official documents clearly state that this is unable to support long-time normal operation, and it must trigger a ZooKeeper Session Timeout event, resulting in service exit.

The document provides four very useful suggestions:

Increase the memory size (but do not tell how much to add, the more it is, the better). Make sure not to use swap partitions (but my hard disk is SSD, which is not much slower than the memory) make sure there are idle CPUs. (What should I do if there are few CPUs ?) Extend the ZooKeeper timeout wait time (this is useful, and it is harmless to extend it as appropriate)

Since it is an event caused by JVM memory reclaim, optimize the JVM parameters to solve it! Take the default 1 GB memory as an example.

Set the Xmn value to 150 M:

Export HBASE_OPTS = "-Xmn150m"

Set GC parameters:

Export SERVER_GC_OPTS = "-XX: CMSInitiatingOccupancyFraction = 80-XX: + UseParNewGC-XX: + UseConcMarkSweepGC"

Explanations:

-The size of the Xmn150m young generation is 150 MB.

"-XX: CMSInitiatingOccupancyFraction = 80 the old generation uses 80% to recycle memory

(1-150 M for the young generation/(1000 M for the total memory-150 M for the young generation) * 100 = 82.35> 80

Make sure that there is a margin to execute the tasks that appear at this time when recycling

-XX: + UseParNewGC: Set the young generation for concurrent collection

-XX: + UseConcMarkSweepGC: set the age for concurrent collection

In this way, hardware resources can be used to support normal operation to the maximum extent.Try it now!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.