MongoDB RAM usage at 85% on Ubuntu server

According to docs ( WiredTiger Storage Engine — MongoDB Manual) MongoDB should be using around 50% of available RAM, but on our server (8GB, 2vCPU, Ubuntu 20.04 arm64) the usage stays around 85 - 90% all the time. And this is just from MongoDB, nothing else is running on the server (checked using top command).

Is this normal? If not what steps should I take to solve it?

The MongoDB instance is running inside a docker container (no resource restrictions)

Lower down on that page:

Via the filesystem cache, MongoDB automatically uses all free memory that is not used by the WiredTiger cache or by other processes.

So, lets say if upgraded to a 64GB RAM instead, it would still try and use up as much as possible? Also, if I have a large enough dataset (100-200 GB+) Is there any chance of it crossing 100% RAM usage and crashing?

With filesystem cache, if the system need ram for anything else the filesystem cached item will be evicted.

The utilization of filesystem cache is to have as much ‘hot’ data in ram as possible so you’re getting good performance instead of reading from disk at a much higher latency.

If you start seeing lots of page faults you know you need to increase ram on the system.

1 Like

@chris suppose we doing a storage based application performance testing so I am supposed to make sure that mongodb consumes all memory and start utilizing the disk and then with sub milisecond latency check the disk performance (throughput i notice) how do i make sure that its reading from disk now like at what point or Pointers to be sure that the IO i am pumping is hitting the disk ?