Skip to content

Commit 5ac96fd

Browse files
committed
DOCS-4844: Document need to limit WiredTiger cache
1 parent 38957d7 commit 5ac96fd

File tree

3 files changed

+28
-12
lines changed

3 files changed

+28
-12
lines changed

source/administration/production-notes.txt

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,12 @@ maintain reasonable connection pool sizes. Adjust the connection pool
175175
size to suit your use case, beginning at 110-115% of the typical number
176176
of concurrent database requests.
177177

178+
When using the :ref:`WiredTiger storage engine <storage-wiredtiger>`,
179+
the number of incoming connections to WiredTiger should be less than
180+
or equal to the number of cores available on the machine.
181+
182+
.. TODO add guidance for MMAPv1
183+
178184
The :dbcommand:`connPoolStats` command returns information regarding
179185
the number of open connections to the current database for
180186
:program:`mongos` and :program:`mongod` instances in sharded clusters.
@@ -214,17 +220,12 @@ WiredTiger will experience negative performance. For information on
214220
active operations, see the active read/write (``ar|aw``) column in the
215221
:program:`mongostat` output.
216222

217-
If you run :program:`mongod` in a container (e.g. ``lxc``, ``cgroups``,
218-
Docker, etc.) that does *not* have access to all of the RAM available
219-
in a system, you must set the
220-
:setting:`wiredTiger.engineConfig.cacheSizeGB` to a value less than the
221-
amount of RAM available in the container. The exact amount depends on
222-
the other processes running in the container.
223-
224-
The size of the WiredTiger cache should be sufficient to hold the
225-
entire working set for the :program:`mongod`. To adjust the size of the
226-
WiredTiger cache, see
227-
:setting:`storage.wiredTiger.engineConfig.cacheSizeGB`.
223+
WiredTiger's default configuration will use either 1GB or half of the
224+
installed physical RAM for cache, whichever is larger. This size is tunable
225+
through the :setting:`storage.wiredTiger.engineConfig.cacheSizeGB` setting, and
226+
should be large enough to hold your entire :term:`working set`.
227+
228+
.. include:: /includes/fact-wiredtiger-cachesizegb.rst
228229

229230
.. seealso:: :ref:`prod-notes-concurrency`
230231

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
By default a :program:`mongod` instance assumes that it is the only instance
2+
running on a node, and will consume system resources accordingly. If a single
3+
node contains multiple instances, then you should change
4+
:setting:`storage.wiredTiger.engineConfig.cacheSizeGB` for each instance to a
5+
value that is large enough to encompass the entire working dataset,
6+
but that also leaves room for the other :program:`mongod` instances.
7+
8+
If you run :program:`mongod` in a container (e.g. ``lxc``, ``cgroups``,
9+
Docker, etc.) that does *not* have access to all of the RAM available
10+
in a system, you must set the
11+
:setting:`storage.wiredTiger.engineConfig.cacheSizeGB` to a value less than the
12+
amount of RAM available in the container. The exact amount depends on
13+
the other processes running in the container.

source/includes/options-mongod.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1573,7 +1573,9 @@ description: |
15731573
15741574
Defines the maximum size of the cache that WiredTiger will use for
15751575
all data. Ensure that {{role}} is sufficient to hold the entire
1576-
working set for the {{program}} instance.
1576+
:term:`working set` for the {{program}} instance.
1577+
1578+
.. include:: /includes/fact-wiredtiger-cachesizegb.rst
15771579
---
15781580
program: mongod
15791581
name: wiredTigerCheckpointDelaySecs

0 commit comments

Comments
 (0)