Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-26312

Multiple high memory usage alerts, MongoDB using 75% of memory for small data size

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Duplicate
    • Affects Version/s: 3.2.6
    • Fix Version/s: None
    • Component/s: WiredTiger
    • Labels:
      None

      Description

      We are using MongoDB 3.2.6 with WiredTiger storageEngine. Below is the Replica set Configuration:

      Replica set Configuration:
      Total members: 3
      Roles: Primary, Secondary, Secondary
      Memory Allocated to each server: 32GB
      Relative data size: 3-4GB

      Issue Summary:
      Memory usage of one of the secondary members has slowly grown and reached up to 75%. This triggers continuous alerts from the monitoring system used to monitor the replica set deployment.

      The memory usage keeps growing gradually hence the alerts are triggered, We mongodb to release memory when the usage is reduced.

      This document on WiredTigers memory usage outlines the memory usage percentage by WiredTiger cache and File system cache. Adhering to those estimations for the aforementioned deployments it should use:
      WiredTiger internal cache memory usage: 60% of RAM minus 1 GB = 16.4GB

      Below are some concerns we need to get addressed:

      1. Will the mongod process go out of memory if the memory usage keeps growing gradually?

      2. Why does it use 75% of memory of relatively small size of data?

      3. Why doesn't wiredTiger releases memory when other operations are performed?

      4. What is the best solution or workaround to mitigate the high memory usage?

      Below are the server specific stats:

      Memory usage:

      PID      USER       PR    NI    VIRT    RES     SHR S  %CPU   %MEM    TIME+ COMMAND
      24371  mongodb   20   0 25.490g 0.022t      7576 S      3.6         75.5      4520:27 mongod
      

      mongostat:

      % dirty % used flushes vsize   res
      0.0        73.6     0          25.5G  22.6G
      

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                6 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: