I am using Mongo-DBv1.8.1. My server memory is 4GB but Mongo-DB is utilizing more than 3GB. Is there memory limitation option in Mongo-DB?.
If you are running MongoDB 3.2 or later version, you can limit the wiredTiger cache as mentioned above. ... # Where and how to store data. storage: dbPath: /var/lib/mongodb journal: enabled: true wiredTiger: engineConfig: cacheSizeGB: 1 ...
The MongoDB statefulset has in production cluster 16 GB as memory limit, but is consuming more, 11 GB, and 20 GB in pre-production (Usually consuming 6-7 GB, which is OK).
The maximum BSON document size is 16 megabytes. The maximum document size helps ensure that a single document cannot use excessive amount of RAM or, during transmission, excessive amount of bandwidth. To store documents larger than the maximum size, MongoDB provides the GridFS API.
What is an in-memory database? An in-memory database is a data storage software that holds all of its data in the memory of the host. The main difference between a traditional database and an in-memory database relies upon where the data is stored.
If you are running MongoDB 3.2 or later version, you can limit the wiredTiger
cache as mentioned above.
In /etc/mongod.conf
add the wiredTiger
part
... # Where and how to store data. storage: dbPath: /var/lib/mongodb journal: enabled: true wiredTiger: engineConfig: cacheSizeGB: 1 ...
This will limit the cache size to 1GB, more info in Doc
This solved the issue for me, running ubuntu 16.04
and mongoDB 3.2
PS: After changing the config, restart the mongo daemon.
$ sudo service mongod restart # check the status $ sudo service mongod status
Starting in 3.2, MongoDB uses the WiredTiger as the default storage engine. Previous versions used the MMAPv1 as the default storage engine.
to limit the wiredTriggered Cache Add following line to .config file :
wiredTigerCacheSizeGB = 1
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With