巍小山 發表於 2025-6-26 18:11:00

HBase Sync功能导致HBase入库性能下降

<p>本文分享自天翼云开发者社区《HBase Sync功能导致HBase入库性能下降》,作者:5****m</p>
<p><strong>问题背景与现象</strong></p>
<p>HBase入库慢,regionserver日志中大量打印slow sync。</p>
<p><strong>原因分析</strong><br>
&nbsp; &nbsp; 1.对比正常写入时间段监控,检查HBase服务整体CPU、内存以及NameNode RPC在异常时间段是否增加;<br>
&nbsp; &nbsp; 2.检查regionserver日志中slow sync打印是否集中在个别RegionServer节点;<br>
&nbsp; &nbsp; 3.如果slow sync集中于个别regionserver节点,检查该节点是否存在热点region、节点RPC是否持续被占用、是否Full GC,请求量是否增加。<br>
&nbsp; &nbsp;4.如果regionserver节点中slow sync无规律,检查datanode日志中slow打印情况,根据slow类型分析写入慢原因;<br>
&nbsp; &nbsp;&nbsp; &nbsp;a.Slow manageWriterOsCache:将块写入OS缓存有延迟。<br>
&nbsp; &nbsp;&nbsp; &nbsp;b.Slow BlockReceiver write packet to mirror :网络上写块有延迟。<br>
&nbsp; &nbsp;&nbsp; &nbsp;c.Slow BlockReceiver write data to disk cost 、Slow flushOrSync:将块写入磁盘有延时。<br>
&nbsp; &nbsp;根据regionserver中写入慢的block id在NameNode日志中查询块写入链路,根据链路信息分析写入三个副本时哪个副本写入有异常,DataNode性能不足,导致写入文件耗时较长。</p>
<p><strong>解决办法</strong><br>
&nbsp; &nbsp;1.网络原因联系网络工程师整改网络<br>
&nbsp; &nbsp;2.磁盘问题需具体分析是磁盘性能不足还是磁盘坏道<br>
&nbsp; &nbsp;3.如果HDFS或HBase服务写入性能已达到瓶颈,可关闭sync功能。</p>
<p>hbase.regionserver.hfile.durable.sync=false</p>
<p>hbase.regionserver.wal.durable.sync=false</p><br><br>
来源:https://www.cnblogs.com/developer-tianyiyun/p/18950655
頁: [1]
查看完整版本: HBase Sync功能导致HBase入库性能下降