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

Working set tracking for in-memory compression

    XMLWordPrintable

Details

    • Improvement
    • Resolution: Unresolved
    • Major
    • Morpheus
    • 7.1.0
    • storage-engine
    • 1

    Description

      Plasma turns on in-memory compression only when memory usage is close to quota. In-memory compression can slow down scan throughput due to decompression cost during scan. In cases where scan working set is within quota but the overall memory use is close to quota, scan pages can still get compressed.

      One way to fix this issue is to track memory stats used by working set. In plasma, the working set are the pages with InUse bit being set. When a page is being used by mutation or scan, the page is marked as InUse. The swapper (eviction) is responsible for resetting the InUse bit as it sweeps through the pages.

      As the swapper resets the bit, it will compress the page (if uncompressed). As the page is compressed, the swapper can calculate the memory (pre-compressed) consumed by this page. We can then adjust the working set memory stats by subtracting the memory of this page.

      As the swapper resets the bit and the page is already compressed, we need to get the memory consumed by the page from compressDelta.

      When a compressed page being marked in-use, we will need to add the memory back to working set stats.

      Currently, for burst eviction, we do not compress a page when inUse bit is reset. We will either have to compress unused page during burst eviction or find another mean to track page memory.

      Attachments

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              jliang John Liang
              jliang John Liang
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There are no open Gerrit changes

                  PagerDuty