Skip to content
English
  • There are no suggestions because the search field is empty.

MongoDB Service Terminated by Linux OOM Killer – Adjusting OOMScoreAdjust to Improve Stability

Original Question or Issue:

MongoDB service becomes unstable or stops unexpectedly due to the Linux OOM (Out-Of-Memory) Killer terminating the process.


Environment:

  • Product - FileCloud Server
  • Version - Any
  • Platform - Linux

Steps to Reproduce:

 


Error or Log Message:

Kernel logs may show entries similar to:

Out of memory: Kill process xxxx (mongod) score xxx or sacrifice childKilled process xxxx (mongod) total-vm:xxxxkB

MongoDB service may stop unexpectedly.


Defect or Enhancement Number:

 


Cause:

Linux OOM Killer selects and terminates the MongoDB process during memory pressure due to its OOM score.


Resolution or Workaround:

Adjust the OOMScoreAdjust value for the MongoDB service to reduce the likelihood of it being terminated:

  1. Run:

    systemctl edit mongod
  2. Add:

    [Service]
    OOMScoreAdjust=-900
  3. Reload and restart:

    systemctl daemon-reload
    systemctl restart mongod
  4. Verify:

    systemctl show mongod | grep OOMScoreAdjust

Notes:

  • No updates have been received from the customer after recommending the OOMScoreAdjust change.