以下是Ubuntu系统上优化HBase性能的关键措施:
-Xms32g -Xmx32g
),并开启MSLAB减少内存碎片。sudo blockdev --setra 32768 /dev/sda
),关闭交换分区(vm.swappiness=0
)。hbase.regionserver.global.memstore.upperLimit
(默认0.4,可适当增大)和lowerLimit
(默认0.38)控制MemStore刷写阈值。hbase.regionserver.handler.count
(默认10,建议20-50)提升并发处理能力。hfile.block.cache.size
(默认0.4,可设为0.6-0.8)提高读缓存命中率。BucketCache
与LRUBlockCache组合,优化热点数据缓存。Put
批量操作)和批量读取(Scan
缓存)减少RPC调用。hbase.hregion.split.policy
)避免热点,合理设置hbase.hregion.max.filesize
(默认10GB,可增大至20GB+)。-XX:+UseG1GC
),小内存使用CMS(-XX:+UseConcMarkSweepGC
),减少Full GC停顿。/etc/sysctl.conf
:增大net.core.rmem_max
和net.core.wmem_max
提升网络吞吐,设置vm.dirty_ratio
(默认20,可降至10)减少脏页刷写延迟。参考来源: