+ All Categories

HBase

Date post: 15-Apr-2017
Category:
Upload: abhilash-kumar
View: 168 times
Download: 2 times
Share this document with a friend
17
Automated heap memory tuner for HBase
Transcript
Page 1: HBase

Automated heap memory tuner

for HBase

Page 3: HBase

Basic Architecture

Page 4: HBase

As with any database, optimized I/O is a critical concern to HBase. When possible, the priority is to not perform any I/O at all. This means that memory utilization and caching structures are of utmost importance. To this end, HBase maintains two cache structures: the “memory store” and the “block cache”.

JVM Heap

Page 5: HBase

When something is written to HBase, it is first written to an in-memory store (memstore), once this memstore reaches a certain size, it is flushed to disk into a store file (everything is also written immediately to a log file for durability). The store files created on disk are immutable.

Memstore

Page 6: HBase

Block cache keeps data blocks resident in memory after they’re read.

Servicing reads from the Block Cache is the primary mechanism through which HBase is able to serve random reads with millisecond latency.

Block Cache

Page 7: HBase

In simple terms we should give more memory to memstore if server is write heavy and we should give more memory to block cache when it is read heavy.

But unfortunately this distribution is hard coded and is 40-40 by default. Which leads to wastage of servers memory.

Current distribution and the problem

Page 8: HBase

Implemented a default Heap Memory Tuner.

There is a configurable time period,after this time interval tuner will regularly check the condition and decide in which direction to shift the memory.

Solution

Page 9: HBase

● Number of flushes● Number of cache misses● Number of evictions● Current sizes of memstore and block cache● Their current max allowed limit ● All the tuner decisions over past few periods

Parameters used

Page 10: HBase

● Warming up period● Feedback based● Tuner direction● Lookup over past periods stats● Varying step size

Tuning process overview

Page 11: HBase

● min/max range on memstore size● min/max range on block cache size● Tuner period ● Lookup periods● Warming up period

Configurable Parameters

Page 12: HBase

There are 13 unit tests that check that tuner works as expected in some common workload scenarios.

They thoroughly test that tuner is on only when it is supposed to.

Unit tests

Page 13: HBase

● Read Only● Write Only● Read heavy● Read heavy with small working set size● 50-50 workload

Testing on actual workloads

Page 14: HBase

Test result from cluster for write heavy job followed by read heavy job.

Page 15: HBase

Two write heavy jobs running One write heavy job runningOne write heavy job + one read heavy job

20 initial tuner periods were ignored.

One read heavy job running

Page 16: HBase

Insert throughput/latency comparison on write heavy job.

What does it improve ?

Default Tuned

Avg. Throughput 12704.01 ops 13706.87 ops

Avg. Latency 2354.81 us 2183.29 us

99th Percentile Latency 3 ms 2 ms

Page 17: HBase

QUESTIONS ? ?

THANK YOU ! !


Recommended