- docker run MongoDB, for restrictions on the docker container to memory resources
- 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
Cgroup mechanism using the Linux kernel limit
Reference https://www.techpaste.com/2016/04/limit-mongodb-memory-usage/