Uploaded image for project: 'Couchbase Server'
  1. Couchbase Server
  2. MB-51320

Investigate block cache hit ratio not reaching 100%

    XMLWordPrintable

Details

    • Task
    • Status: Closed
    • Major
    • Resolution: Fixed
    • Morpheus
    • Morpheus
    • storage-engine
    • 1
    • Magma May 2022

    Description

      While doing read random benchmark for Magma paper, even when block cache was given ample memory to have a 100% index resident ratio, block cache hit ratio was not reaching 100%. Maximum it reached is 98%. Investigate why.

      Attachments

        For Gerrit Dashboard: MB-51320
        # Subject Branch Project Status CR V

        Activity

          rohan.suri Rohan Suri added a comment -

          The reason is this check.

          // BlockCache sizing.    
          auto bCacheSize = static_cast<size_t>(avail * (1 - cfg.WriteCacheRatio));
          if (bCacheSize > usage.IndexBlockSize) { 
                 bCacheSize = usage.IndexBlockSize;
          }

          We size block cache exactly depending on the index size. But block cache's internal overheads and jemalloc's internal fragmentation could require more memory than what the index size is on disk. Hence we need some buffer space added here so that block cache is able to cache everything when there's ample memory available.

          rohan.suri Rohan Suri added a comment - The reason is this check. // BlockCache sizing. auto bCacheSize = static_cast<size_t>(avail * (1 - cfg.WriteCacheRatio)); if (bCacheSize > usage.IndexBlockSize) { bCacheSize = usage.IndexBlockSize; } We size block cache exactly depending on the index size. But block cache's internal overheads and jemalloc's internal fragmentation could require more memory than what the index size is on disk. Hence we need some buffer space added here so that block cache is able to cache everything when there's ample memory available.

          Build couchbase-server-7.2.0-1025 contains magma commit d043a37 with commit message:
          MB-51320 magma: Add stat for dropped blocks in block cache

          build-team Couchbase Build Team added a comment - Build couchbase-server-7.2.0-1025 contains magma commit d043a37 with commit message: MB-51320 magma: Add stat for dropped blocks in block cache

          Build couchbase-server-7.2.0-1032 contains magma commit e949209 with commit message:
          MB-51320 magma: Add stat for cached blocks size as per sizeof operator

          build-team Couchbase Build Team added a comment - Build couchbase-server-7.2.0-1032 contains magma commit e949209 with commit message: MB-51320 magma: Add stat for cached blocks size as per sizeof operator
          rohan.suri Rohan Suri added a comment -

          Verified the fix works on magma_bench.

          rohan.suri Rohan Suri added a comment - Verified the fix works on magma_bench.

          Build couchbase-server-7.2.0-1052 contains magma commit 90a6c9e with commit message:
          MB-51320 magma: Fix block cache not reaching 100% residency

          build-team Couchbase Build Team added a comment - Build couchbase-server-7.2.0-1052 contains magma commit 90a6c9e with commit message: MB-51320 magma: Fix block cache not reaching 100% residency

          People

            rohan.suri Rohan Suri
            rohan.suri Rohan Suri
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There is 1 open Gerrit change

                PagerDuty