How to Limit MongoDB’s Maximum Memory Consumption?

  mongodb, question

If you want to reserve some memory from the machine where mongodb is deployed, how can you limit mongodb’s memory usage while allowing mongodb’s performance to decline?

Ulimit or cgroup.