HBase Practice At XiaoMiHBASE-19358 ❏ Problem: Log splitting has a bad performance or even not working when the number of region is very large, e.g 1000+ per regionserver Create WriterAndPath Create WriterAndPath Create log writers) getChunkToWrite Write the largest chunk Close all writers at the end Region 1 Region 2 Region 3 Region 4 Old design of log splitting Log splitting problem - 1 ❏ Too much space need to able to assign enough space to create a new block. Reserved space = number of Log * number of region * configured size of HLog block * number of replica ❏ Especially for a small hdfs cluster, whose0 码力 | 56 页 | 350.38 KB | 1 年前3
HBase最佳实践及优化SQL(传统BI)不友好,不支持很多传统DBMS 功能,如外键,约束… • 数据无类型 • 非RowKey查询性能差 • Column Family限制(数目,Partition对齐) • Region资源消耗大,实例数目不能太多 • 无法保证服务质量* – Split/Compaction等操作对集群性能影响极大 • 多租户隔离能力差 • 大内存(>100GB)管理差 12 Postgres 集群Master和Zookeeper 节点 IBM 3650 PC,双路六核,Intel X5650处理器, 2.66GHz主频,48GB内存,6*1TB SATA硬盘 5台 DataNode/TaskTracker/Region Server IBM 3650 PC,双路六核,Intel X5650处理器, 2.66GHz主频,48GB内存,6*1TB SATA硬盘 69台 HBase Thrift服务器节点/查询服 将数据另存储为一行还是”覆盖”存储为列(Column)的不同版 本 • 将数据另存储为一行还是增加一个列 • 建议 • 通常情况下的回答: 分行存储 » 能获得更好的Get以及scan的性能 » 太长的行记录不利于做Region的split • 行设计必须符合数据原子性操作要求 » HBase只保证行级别数据的原子性操作 29 Postgres Conference China 2016 中国用户大会 RowKey设计0 码力 | 45 页 | 4.33 MB | 1 年前3
HBase基本介绍multidimensional sorted map. 回顾: 稀疏的, ⾏行行和列列⽐比较随意, 不不需要固定的schema, 没有值的位置不不占空间 分布式的, 本身hdfs的是分布式的容错的, 在借助region和cf的⽔水平垂直分表, 整个数据可以很好的分散 持久化的, ⼤大部分数据都是基于hdfs的持久化,(btw 顺序写磁盘, 速度不不慢) Sorted map. 整个数据模型就是⼀一个按key排序的⼤大Map ⽔水平 按rowkey分开 region • Pre-split: 0-5 6-10 • Auto-split: size • 垂直 按CF分开 系统组成 Region ⽔水平按rowkey分. 这个分两步, 第⼀一个是在建表的时候指定分的⽅方式. ⽐比如两个split, 0-5 6-10 ⾃自动分区是指⼀一个region⼤大⼩小超了了 region的概念. 这个很类似关系数据库⾥里里我们说⽔水平/垂直分表的意思 ⾜足够⼤大时flush到HFile • Compaction (Minor/Major) 系统组成 RegionServer写操作 ⼀一个Region多个CF就多个Memstore 在Memstore⾥里里已经处理理好格式, 排序 有⼀一个Memstore满了了, 就整个Region flush 这⾥里里每隔⼀一会就flush, 会⽣生成很多⼩小的HFile, HBase会执⾏行行两种compaction0 码力 | 33 页 | 4.86 MB | 1 年前3
HBase Practice At Xiaomiblocked if a region server blocked when using blocking client Get Stuck Availability: 66% Availability: 0% Why Async HBase Client ? ● Region Server / Master STW GC ● Slow RPC to HDFS ● Region Server Heap: 30G Heap + 30G OFF-Heap ● CPU: 24 Core ● DISK: 4T x 12 HDD ● Network Interface: 10Gb/s 5 Region Server HBase Cluster Initial JVM Options -Xmx30g -Xms30g -XX:MaxDirectMemorySize=30g -XX:+UseG1GC MaxTenuringThreshold Maximum value for tenuring threshold. (value: 1) G1HeapRegionSize Sets the size of a G1 region. (value: 32m) G1MixedGCCountTarget The target number of mixed garbage collections after a marking0 码力 | 45 页 | 1.32 MB | 1 年前3
HBASE-21879 Read HFile ’s Block into ByteBuffer directly.2 GB 4.6 GB -81.7% GC Details Update RememberSet (ms) 0.9987 ms 0.9940 ms -0.4% Region Chosen Each GC 809 150 -81.5% G1 Object Copy (ms) 116.98 ms 108.98 ms -6.8% QPS & Latency Usage (GB) 3.3 2.2 -33% GC Details Update RememberSet (ms) 7.48 ms 7.03 ms -6% Region Chosen Each GC 91 58 -36% G1 Object Copy (ms) 21 ms 20 ms -4% QPS & Latency Get (GB) 30GB 30GB 0.0% GC Details Update RememberSet (ms) 1.010 ms 1.000 ms -0.9% Region Chosen Each GC 960 960 0.0% G1 Object Copy (ms) 0.294 ms 0.252 ms -14.2% QPS & Latency0 码力 | 18 页 | 1.14 MB | 1 年前3
共 5 条
- 1













