Uploaded image for project: 'HBase'
  1. HBase
  2. HBASE-7404

Bucket Cache:A solution about CMS,Heap Fragment and Big Cache on HBASE

    Details

    • Type: New Feature
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 0.94.3
    • Fix Version/s: 0.95.0
    • Component/s: None
    • Labels:
      None
    • Hadoop Flags:
      Reviewed
    • Release Note:
      Hide
      BucketCache is another implementation of BlockCache which supports big block cache for high performance and would greatly decrease CMS and heap fragmentation in JVM caused by read activities.


      Usage:

      1.Use bucket cache as main memory cache, configured as the following:
      –"hbase.bucketcache.ioengine" "heap"
      –"hbase.bucketcache.size" 0.4 (size for bucket cache, 0.4 is a percentage of max heap size)

      2.Use bucket cache as a secondary cache, configured as the following:
      –"hbase.bucketcache.ioengine" "file:/disk1/hbase/cache.data"(The file path where to store the block data)
      –"hbase.bucketcache.size" 1024 (size for bucket cache, unit is MB, so 1024 means 1GB)
      –"hbase.bucketcache.combinedcache.enabled" false (default value being true)
      Show
      BucketCache is another implementation of BlockCache which supports big block cache for high performance and would greatly decrease CMS and heap fragmentation in JVM caused by read activities. Usage: 1.Use bucket cache as main memory cache, configured as the following: –"hbase.bucketcache.ioengine" "heap" –"hbase.bucketcache.size" 0.4 (size for bucket cache, 0.4 is a percentage of max heap size) 2.Use bucket cache as a secondary cache, configured as the following: –"hbase.bucketcache.ioengine" "file:/disk1/hbase/cache.data"(The file path where to store the block data) –"hbase.bucketcache.size" 1024 (size for bucket cache, unit is MB, so 1024 means 1GB) –"hbase.bucketcache.combinedcache.enabled" false (default value being true)
    • Tags:
      0.96notable

      Description

      First, thanks @neil from Fusion-IO share the source code.

      Usage:

      1.Use bucket cache as main memory cache, configured as the following:
      –"hbase.bucketcache.ioengine" "heap" (or "offheap" if using offheap memory to cache block )
      –"hbase.bucketcache.size" 0.4 (size for bucket cache, 0.4 is a percentage of max heap size)

      2.Use bucket cache as a secondary cache, configured as the following:
      –"hbase.bucketcache.ioengine" "file:/disk1/hbase/cache.data"(The file path where to store the block data)
      –"hbase.bucketcache.size" 1024 (size for bucket cache, unit is MB, so 1024 means 1GB)
      –"hbase.bucketcache.combinedcache.enabled" false (default value being true)

      See more configurations from org.apache.hadoop.hbase.io.hfile.CacheConfig and org.apache.hadoop.hbase.io.hfile.bucket.BucketCache

      What's Bucket Cache?
      It could greatly decrease CMS and heap fragment by GC
      It support a large cache space for High Read Performance by using high speed disk like Fusion-io

      1.An implementation of block cache like LruBlockCache
      2.Self manage blocks' storage position through Bucket Allocator
      3.The cached blocks could be stored in the memory or file system
      4.Bucket Cache could be used as a mainly block cache(see CombinedBlockCache), combined with LruBlockCache to decrease CMS and fragment by GC.
      5.BucketCache also could be used as a secondary cache(e.g. using Fusionio to store block) to enlarge cache space

      How about SlabCache?
      We have studied and test SlabCache first, but the result is bad, because:
      1.SlabCache use SingleSizeCache, its use ratio of memory is low because kinds of block size, especially using DataBlockEncoding
      2.SlabCache is uesd in DoubleBlockCache, block is cached both in SlabCache and LruBlockCache, put the block to LruBlockCache again if hit in SlabCache , it causes CMS and heap fragment don't get any better
      3.Direct heap performance is not good as heap, and maybe cause OOM, so we recommend using "heap" engine

      See more in the attachment and in the patch

        Attachments

        1. Introduction of Bucket Cache.pdf
          966 kB
          chunhui shen
        2. hbase-7404-trunkv9.patch
          130 kB
          chunhui shen
        3. hbase-7404-trunkv2.patch
          125 kB
          chunhui shen
        4. HBASE-7404-backport-0.94.patch
          152 kB
          Dave Latham
        5. hbase-7404-94v2.patch
          122 kB
          chunhui shen
        6. BucketCache.pdf
          292 kB
          chunhui shen
        7. 7404-trunk-v14.patch
          133 kB
          chunhui shen
        8. 7404-trunk-v13.txt
          133 kB
          chunhui shen
        9. 7404-trunk-v13.patch
          133 kB
          chunhui shen
        10. 7404-trunk-v12.patch
          131 kB
          chunhui shen
        11. 7404-trunk-v11.patch
          131 kB
          Ted Yu
        12. 7404-trunk-v10.patch
          131 kB
          Ted Yu
        13. 7404-0.94-fixed-lines.txt
          131 kB
          Lars Hofhansl

          Issue Links

            Activity

              People

              • Assignee:
                zjushch chunhui shen
                Reporter:
                zjushch chunhui shen
              • Votes:
                7 Vote for this issue
                Watchers:
                57 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: