Why is MongoDB using so much memory?

Why is MongoDB using so much memory?

In sum, the mongod process will consume more and more memory as it fills up its cache. So people have reasoned that if your computer is running out of memory then you should limit the memory made available to MongoDB. But MongoDB uses both its internal cache and the system’s file system cache.

What is WiredTiger MongoDB?

WiredTiger is a NoSQL, Open Source extensible platform for data management. The WiredTiger storage engine is the default storage engine starting in MongoDB version 3.2. It provides a document-level concurrency model, checkpointing, and compression, among other features.

How much memory is MongoDB using?

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).

How do I reduce space in MongoDB?

  1. Export the database to another computer with Mongo installed (using mongoexport ) and then you can Import that same database (using mongoimport ). This will result in a new database that is more compressed.
  2. Stop the current mongod and copy the database files to a bigger computer and run the repair on that computer.

Is 8gb RAM enough for MongoDB?

MongoDB requires approximately 1GB of RAM per 100.000 assets. If the system has to start swapping memory to disk, this will have a severely negative impact on performance, and should be avoided.

What engine does MongoDB use?

WiredTiger
WiredTiger is the default storage engine starting in MongoDB 3.2. It is well-suited for most workloads and is recommended for new deployments. WiredTiger provides a document-level concurrency model, checkpointing, and compression, among other features. In MongoDB Enterprise, WiredTiger also supports Encryption at Rest.

What kind of concurrency control does MongoDB use?

For most read and write operations, WiredTiger uses optimistic concurrency control. WiredTiger uses only intent locks at the global, database and collection levels. When the storage engine detects conflicts between two operations, one will incur a write conflict causing MongoDB to transparently retry that operation.

Which is the default storage engine in MongoDB?

Starting in MongoDB 3.2, the WiredTiger storage engine is the default storage engine. For existing deployments, if you do not specify the –storageEngine or the storage.engine setting, the version 3.2+ mongod instance can automatically determine the storage engine used to create the data files in the –dbpath or storage.dbPath.

How does WiredTiger work with MongoDB checkpoints?

WiredTiger uses a write-ahead log (i.e. journal) in combination with checkpoints to ensure data durability. The WiredTiger journal persists all data modifications between checkpoints. If MongoDB exits between checkpoints, it uses the journal to replay all data modified since the last checkpoint.

How does block compression work in MongoDB server?

Block compression can provide significant on-disk storage savings, but data must be uncompressed to be manipulated by the server. Via the filesystem cache, MongoDB automatically uses all free memory that is not used by the WiredTiger cache or by other processes.