[SERVER-2513] Ability to limit amount of resident memory that MongoDB can utilize Created: 09/Feb/11  Updated: 13/Aug/14  Resolved: 10/Feb/11

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: New Feature Priority: Major - P3
Reporter: Justin Smestad Assignee: Unassigned
Resolution: Duplicate Votes: 5
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
is duplicated by SERVER-14777 Option to limit physical memory used ... Closed
Related
related to DOCS-3898 Provide an example of CGROUPS usage t... Closed
Backwards Compatibility: Fully Compatible
Participants:

 Description   

Would like to see the ability to limit the maximum amount of memory that a MongoDB process can consume. This feature would allow MongoDB to run alongside other processes without fighting for memory space. Additionally it would allow for performance testing to be done to find the acceptable memory footprint for a given working dataset.



 Comments   
Comment by Kevin J. Rice [ 05/Aug/14 ]

This line of questions presumes a server dedicated to Mongo. Not all instances of Mongo are on dedicated servers (VMs or real iron). It's reasonable to have other things running on server, either applications or multiple mongod instances. It would be nice to be able to have MongoDB limit its own RSS memory usage.

Barring that, a documentation workaround for implementing Linux 'Control Groups' with this would be nice.

Comment by Eliot Horowitz (Inactive) [ 19/Mar/11 ]

@jiwei i think you're misunderstanding. the os will determine how much of the physical memory mongo is allocated. in the cloud this works particularly well since you general spin up many correctly sized instances. so if you need 1gb ram for mongo, and 100gb of disk, you spin up a node like that, and give it to mongo

Comment by Justin Smestad [ 18/Mar/11 ]

Yeah we can just close out the ticket.

Comment by Jiwei [ 18/Mar/11 ]

This is a deal breaker to us.
You can not require user to limit data size to excuse you can not limit max memory usage.
If we just want mongod consume maximum 256M memory, mongodb still needs be able to serve 2G data there. This is basic db software should do. Expecially for today cloud's environment, we want each VM only take 500M-1G memory, you are just one software we are evaluating and can not take all memory in a VM instance.
Unless I miss something here .

Comment by Eliot Horowitz (Inactive) [ 10/Feb/11 ]

@justin, that is exactly limiting the resident memory used by mongod, which is exactly what the linked case is about

Comment by Scott Hernandez (Inactive) [ 10/Feb/11 ]

How do you expect this to work? The OS manages memory for memory mapped files. Are you going to limit the data, and therefor file sizes, the user can create for each of the mongod instances?

Comment by Justin Smestad [ 10/Feb/11 ]

I'm looking for the ability to say that I have a 12GB server, and then 6 MongoDB daemons should use no more than 1GB of memory each. Leaving me with 6GB of RAM untouched.

Comment by Eliot Horowitz (Inactive) [ 10/Feb/11 ]

The title says resident memory.

Which do you mean?

To be clear, if you limit virtual memory, then you're limiting data size.

So that would be a max data size option.
You can easily simulate that with a mounted image.

Comment by Justin Smestad [ 10/Feb/11 ]

This was requesting a way to limit the amount of virtual memory MongoDB can use so you can build contained Mongo daemons that can leave free memory space.

Comment by Eliot Horowitz (Inactive) [ 10/Feb/11 ]

See SERVER-219

Generated at Thu Feb 08 03:00:15 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.