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

Account for container memory and cpu limits in plasma storage

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Critical
    • 7.1.0
    • 7.1.0
    • storage-engine
    • Untriaged
    • 1
    • No

    Description

      Plasma mem tuner uses sigar to get system memory stats (TotalMemory, FreeMemory and FreePercent). In a container environment, sigar will return the values for the host machine and not for the container. This can lead to plasma mem quota to not be tuned correctly and lead to OOM kill of indexer process. OOM killer operates on the cgroup memory limit.

      ns_server exposes some system stats. These stats include some that come from sigar and some that are from local stats. The local stats include both memory and cpu stats and they are collected by reading certain files as follows:

      memory:
      https://github.com/couchbase/ns_server/blob/2b88cc336504c74e22c5b2ac59ce5488ac200c45/src/memory_quota.erl#L35

      Should also consider these stats in mem tuner instead of relying only on sigar.

      cpu:
      https://github.com/couchbase/ns_server/blob/2b88cc336504c74e22c5b2ac59ce5488ac200c45/src/misc.erl#L1736

      Should consider these stats in GetCPUPercent() so that swapperContext rebalance works as expected.

      Attachments

        Issue Links

          Activity

            People

              sanjit.chauhan Sanjit Chauhan (Inactive)
              akhil.mundroy Akhil Mundroy
              Votes:
              0 Vote for this issue
              Watchers:
              11 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                PagerDuty