What is the total maximum memory limit on the wiredTiger engine?

What is the total maximum memory limit on the wiredTiger engine in the most recent version?

storage.wiredTiger.engineConfig.cacheSizeGB

  • 50% of (RAM - 1 GB), or 256 MB.

maxIndexBuildMemoryUsageMegabytes

  • 200 MB

Is it an addition to these two?
Or can you set 80% of memory by setting it up?

Hi @Kim_Hakseon

Those are two separate things.

storage.wiredTiger.engineConfig.cacheSizeGB governs the WiredTiger cache size. This is the “working memory” of WiredTiger.

maxIndexBuildMemoryUsageMegabytes governs the maximum memory usage when building an index. This is separate from WiredTiger’s memory usage.

Currently there is no setting to limit the overall memory usage of a mongod. What I mean by mongod memory usage is memory used by anything other than low level WiredTiger work, e.g. for index builds, aggregation, in-memory sort, connection handling, etc. Generally, this means that WiredTiger reserves about half of RAM for its use, and the rest is to be used by the mongod process (and also all other processes in the server, including the OS). This is the reason why it’s not recommended to run multiple mongod processes in the same server: all of them will compete for memory access.

Best regards
Kevin

1 Like

First of all, thank you for your kind reply.

To summarize the above, can I understand that there is no maximum usage of memory explicitly or implicitly at the moment in mongodb?
(ex: mongodb implicitly uses up to 80% of memory.)

Hi @Kim_Hakseon

(ex: mongodb implicitly uses up to 80% of memory.)

I would say that it’s best to assume MongoDB uses up to 100% of memory in a server: ~50% for the storage engine (WiredTiger in the default case), and up to ~50% for other MongoDB uses. Having MongoDB take all the memory it requires allows it to perform its best with the hardware it’s given without hindrance from artificially limiting memory usage.

Best regards
Kevin

Thanks to your quick response, my curiosity was completely solved.

Corona is going crazy again in Korea these days, so please be careful and have a good day today.

1 Like

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.