[DOCS-12599] Docs for SERVER-16571: Use Actual Memory Constraint vs. Total System Memory When They Differ Created: 03/Apr/19  Updated: 13/Nov/23  Resolved: 08/Aug/19

Status: Closed
Project: Documentation
Component/s: manual, Server
Affects Version/s: None
Fix Version/s: 4.1.9, 4.0.9, 3.6.13, Server_Docs_20231030, Server_Docs_20231106, Server_Docs_20231105, Server_Docs_20231113

Type: Task Priority: Major - P3
Reporter: Kay Kim (Inactive) Assignee: Kay Kim (Inactive)
Resolution: Fixed Votes: 0
Labels: containers, docker, docs-backport-done, kubernetes
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Documented
documents SERVER-16571 Use Actual Memory Constraint vs. Tota... Closed
Related
related to DOCS-13072 SELinux and actual memory usage warnings Closed
Participants:
Days since reply: 4 years, 27 weeks ago
Epic Link: DOCS: 4.2 Server/Tools

 Description   

Description

Description:

We should add a note here: https://docs.mongodb.com/manual/core/wiredtiger/#memory-use
Which says that if the database has memory limits placed on it which are lower than the system memory, for example when running in a container, then that is used as the maximum RAM available rather than the total system memory.
We should do something similar anywhere else that we call out memory calculations anywhere else that are used for actions/defaults related to the memory available to MongoDB.

We should note that the hostInfo command contains a new field, memLimitMB, which tells you if the host is placing any memory usage limit on the process (for example when using containers).

Note: this work was backported to 4.0 and 3.6.

Engineering Ticket Description:

The memory size is taken into account within various components today:

  1. We set the default WiredTiger cache_size to approximately 1/2 of the memory size
  2. When ephemeral storage is in use we consider the memory limit in place to determine the default oplog size
  3. We set the tcmalloc cache size to 1/8th of the available memory

In all of these cases we should take the actual memory constraint that we're operating under into account rather than the total system memory – for example when running MongoDB within containers.

Scope of changes

Impact to Other Docs

MVP (Work and Date)

Resources (Scope or Design Docs, Invision, etc.)



 Comments   
Comment by Githook User [ 08/Aug/19 ]

Author:

{'name': 'Kay Kim', 'email': 'kay.kim@10gen.com', 'username': 'kay-kim'}

Message: DOCS-12599: 3.6.13 memlimit
Branch: v3.6
https://github.com/mongodb/docs/commit/f45be84e2d7ea6ec6efc719c982c253c1461d862

Comment by Githook User [ 08/Aug/19 ]

Author:

{'name': 'Kay Kim', 'email': 'kay.kim@10gen.com', 'username': 'kay-kim'}

Message: DOCS-12599: 4.0.9 memlimit
Branch: v4.0
https://github.com/mongodb/docs/commit/7a5514018b1ea090842e8b2dfbce27cbb32df30e

Comment by Githook User [ 08/Aug/19 ]

Author:

{'name': 'Kay Kim', 'email': 'kay.kim@10gen.com', 'username': 'kay-kim'}

Message: DOCS-12599: 4.0.9 memlimit
Branch: master
https://github.com/mongodb/docs/commit/84eed3a52e6642805262f1114a7fd73aaf9e295b

Comment by Brian Lane [ 03/Jun/19 ]

https://docs.mongodb.com/manual/administration/production-notes/index.html

Also has a blurb stating: If you run mongod in a container (e.g. lxc, cgroups, Docker, etc.) that does not have access to all of the RAM available in a system, you must set storage.wiredTiger.engineConfig.cacheSizeGB to a value less than the amount of RAM available in the container. The exact amount depends on the other processes running in the container.

Generated at Thu Feb 08 08:05:39 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.