【GHS】HBase内存配置及JVM优化

编程开发   © 文章版权由 admin 解释,禁止匿名转载

#楼主# 2020-12-30

## 前言 本文从HBase的内存布局说起,先充分了解HBase的内存区的使用与分配,随后给出了不同业务场景下的读写内存分配规划,并指导如何分析业务的内存使用情况,以及在使用当中写内存Memstore及读内存扩展bucketcache的一些注意事项,最后为了保障群集的稳定性减少和降低GC对于集群稳定性的影响,研究及分享了一些关于HBase JVM配置的一些关键参数机器作用和范例,希望这些不断充实的经验能确保HBase集群的稳定性能更上一个台阶,大家有任何的想法和建议也欢迎一起讨论。 ## HBase的内存布局 一台region server的内存使用(如下图所示)主要分成两部分: 1.JVM内存即我们通常俗称的堆内内存,这块内存区域的大小分配在HBase的环境脚本中设置,在堆内内存中主要有三块内存区域, * 20%分配给hbase regionserver rpc请求队列及一些其他操作 * 80%分配给memstore + blockcache 2.java direct memory即堆外内存, * 其中一部分内存用于HDFS SCR/NIO操作 * 另一部分用于堆外内存bucket cache,其内存大小的分配同样在hbase的环境变量脚本中实现 ![](https://img2020.cnblogs.com/blog/1247138/202012/1247138-20201230094456070-918493241.png) ## 读写内存规划 - 写多读少型规划 在详细说明具体的容量规划前,首先要明确on heap模式下的内存分布图,如下图所示: ![](https://img2020.cnblogs.com/blog/1247138/202012/1247138-20201230094601780-1337388836.png) 如图,整个RegionServer内存就是JVM所管理的内存,BlockCache用于读缓存;MemStore用于写流程,缓存用户写入KeyValue数据;还有部分用于RegionServer正常RPC请求运行所必须的内存; 步骤 | 原理 | 计算 | 值 ---|---|---|--- jvm_heap | 系统总内存的 2/3 | 128G/3*2 | 80G blockcache | 读缓存 | 80G*30% | 24
hbase.bucketcache.ioengine | none | Where to store the contents of the BucketCache. Its value can be offheap、heap、file hfile.block.cache.size | 0.4 | A float between 0.0 and 1.0. This factor multiplied by the Java heap size is the size of the L1 cache. In other words, the percentage of the Java heap to use for the L1 cache. hbase.bucketcache.size | not set | When using BucketCache, this is a float that represents one of two different values, depending on whether it is a floating-point decimal less than 1.0 or an integer greater than 1.0.
If less than 1.0, it represents a percentage of total heap memory size to give to the cache.
If greater than 1.0, it represents the capacity of the cache in megabytes
-XX:MaxDirectMemorySize | MaxDirectMemorySize = BucketCache + 1 | A JVM option to configure the maximum amount of direct memory available for the JVM. It is automatically calculated and configured based on the following formula: MaxDirectMemorySize = BucketCache size + 1 GB for other fe。

成为第一个回答人

评论

登录后才可发表内容
  • 主题

    106

  • 帖子

    82

  • 关注者

    0

Copyright © 2019 凯特网.   Powered by HYBBS 2.3.4  

Runtime:1.3906s Mem:2049Kb