Is there any way to limit using RAM for mongodb on Debian? I'm looking for a solution fo about 8 hours, but have no results.

  • You could use ulimit but it could effect performance if your working set exceeds the amount you allocate
    – Sammaye
    Commented Jan 5, 2013 at 23:42

2 Answers 2


I have heard that some folks have had success using lxc to isolate MongoDB on Linux. There are other container technologies out there, but that seems to be the most mainstream option.


It is possible using cgroups.

Some tutorials are available as well as shell script for Ubuntu 14.04.

See also Is there any option to limit mongodb memory usage? on Stack Overflow.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.