Hi Nick
Could you elaborate on how you determine that MongoDB is using >3 GB? Note that by “cache size” I’m assuming you meant the WiredTiger cache size setting.
Please note that WiredTiger cache size setting governs only the maximum cache size of WiredTiger, and not the overall MongoDB memory use. Other processes such as client connection, aggregation framework, queries, etc. uses memory on top of WiredTiger cache usage. Therefore, a busy server could use significantly more memory on top of the WiredTiger cache size setting.
Having said that, as of MongoDB 3.6.2, there is currently no built-in method to limit MongoDB memory usage, since MongoDB was designed to utilize as much memory as possible to give you the best performance.
For diagnosing memory usage, you may be able to use Memory Diagnostics for the WiredTiger Storage Engine as a starting point.
Best regards
Kevin
Hi Nick
Before digging into diagnostics, could you specify the environment you’re running? Such as your deployment topology (standalone, replica set, etc.), your OS version, and your hardware specification?
I was sent a screenshot of task manager showing the mongo db process using >3GB of memory
Just so we’re on the same page, are you seeing any performance issues due to this memory usage, or is this a one-time event that you’re curious about? Also, does the memory usage stabilize at some value after a while?
it is entirely possible that there is some edge-case workload going on here which is causing MongoDB to bump up to 3x the wiredTigerCacheSizeGB setting
If finding an edge-case workload is the goal, it’s generally more precise to identify the workload in question by looking at mongod logs. Things to look for could include:
mloginfo from the mtools package could show you the slow queries during this period.mongod would allocate an extra 1 GB of RAM to handle them.Also since you’re using 3.2.10, could you try to upgrade to the latest in the 3.2 series (currently 3.2.18) and see if the issue persists?
Best regards
Kevin
Hi Anthony
I’m currently experiencing the same kind of issue on linux with mongo 3.4.1
Although the issue looks superficially similar, chances are it’s a different issue.
Could you please open a new thread with your issue so that we’re not talking about two different things in this thread?
Best regards
Kevin