We use mongo for logging user actions in the program. Users more than a hundred people, the base is growing rapidly. Is it possible to limit the use of RAM?
Closed due to the fact that the question is too general for the participants aleksandr barakin , VenZell , fori1ton , D-side , VAndrJ 24 Mar '16 at 12:40 .
Please correct the question so that it describes the specific problem with sufficient detail to determine the appropriate answer. Do not ask a few questions at once. See “How to ask a good question?” For clarification. If the question can be reformulated according to the rules set out in the certificate , edit it .
1 answer
With relatively large sizes of your database and indexes, MongoDB will use all available memory for caches, logs , etc.
Also, the memory consumption depends on the selected data storage. Check out the Memory Use sections for MMAPv1 and for WiredTiger .
In short, most of the memory occupied by MongoDB is actually still controlled by the operating system. And if some other application needs more memory, MongoDB will free it.
For WiredTiger, there is an option storage.wiredTiger.engineConfig.cacheSizeGB , which allows you to limit the cache of WiredTiger. But the cache is not all that MongoDB takes up memory, so when changing this option, do not count on predictable results.
Conclusion: you will not be able to manually limit the memory occupied by MongoDB. But this need not be done, because the memory will be freed automatically if the OS or other programs need it.