限制mongodb启动时占用过多内存的方法-创新互联
创新互联www.cdcxhl.cn八线动态BGP香港云服务器提供商,新人活动买多久送多久,划算不套路!
这篇文章主要介绍限制mongodb启动时占用过多内存的方法,文中介绍的非常详细,具有一定的参考价值,感兴趣的小伙伴们一定要看完!
默认情况下,mongodb占用的内存大小为:
Starting in 3.4, the WiredTiger internal cache, by default, will use the larger of either: 50% of RAM minus 1 GB, or 256 MB.
下面我们来看一下限制mongodb启动时占用内存的方法:
新增配置文件 /etc/mongod.conf
storage: dbPath: /var/lib/mongodb journal: enabled: true # engine: mmapv1: smallFiles: true wiredTiger: engineConfig: configString : cache_size=160M
然后以配置文件的方式启动:
mongod -f /etc/mongod.conf --fork --logpath=/etc/mongodb.log
以上是限制mongodb启动时占用过多内存的方法的所有内容,感谢各位的阅读!希望分享的内容对大家有帮助,更多相关知识,欢迎关注创新互联-成都网站建设公司行业资讯频道!
本文名称:限制mongodb启动时占用过多内存的方法-创新互联
本文URL:http://azwzsj.com/article/dphdoo.html