Increase MongoDB memory limit(or any resources it uses)

1.8k views Asked by At

I will rent a cloud server(12gb ram, 240gb nvme sdd). I read mongodb wiredtiger uses limited amount of system memory,

Since MongoDB 3.2, MongoDB has used WiredTiger as its default Storage Engine. And by default, MongoDB will reserve 50% of the available memory – 1 GB for the WiredTiger cache or 256 MB whichever is greater.

Since i will rent this server just for mongodb(i will have high throughput), i want wiredtiger to use all available system resources, how can i achieve this?. Thank you

1

There are 1 answers

0
Stephen Taylor On

Edit your mongo.conf. This file is usually located at /etc/mongo.conf

change this section:

storage:
  dbPath: /var/lib/mongodb #(example) - don't change this
  journal:
    enabled: true
  wiredTiger:
    engineConfig:
      cacheSizeGB: 12

You may want to experiment with the size to test the stability of your server (may want to make it 1 GB less). Remember to restart the mongod service.