創(chuàng)新互聯(lián)www.cdcxhl.cn八線動態(tài)BGP香港云服務(wù)器提供商,新人活動買多久送多久,劃算不套路!
這篇文章主要介紹限制mongodb啟動時占用過多內(nèi)存的方法,文中介紹的非常詳細(xì),具有一定的參考價值,感興趣的小伙伴們一定要看完!
默認(rèn)情況下,mongodb占用的內(nèi)存大小為:
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啟動時占用內(nèi)存的方法:
新增配置文件 /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啟動時占用過多內(nèi)存的方法的所有內(nèi)容,感謝各位的閱讀!希望分享的內(nèi)容對大家有幫助,更多相關(guān)知識,歡迎關(guān)注創(chuàng)新互聯(lián)-成都網(wǎng)站建設(shè)公司行業(yè)資訊頻道!