MongoDB memory limit of the method

  1. docker run MongoDB, for restrictions on the docker container to memory resources
  2. MongoDB modify the running configuration file, and restart mongodb
storage:
  dbPath: /var/lib/mongodb
  journal:
    enabled: true
#  engine:
  mmapv1:
    smallFiles: true
  wiredTiger:
    engineConfig:
      configString : cache_size=160M
  1. Cgroup mechanism using the Linux kernel limit

    Reference https://www.techpaste.com/2016/04/limit-mongodb-memory-usage/

Guess you like

Origin www.cnblogs.com/joinbestgo/p/11448823.html