开发者

Can you turn off MongoDB caching?

开发者 https://www.devze.com 2023-03-26 22:00 出处:网络
Can you turn off MongoDB cacheing? We are using Redis to store active data. We plan to use redis to hold this data in a normalized way while it is being used. One of the sources that passes data into

Can you turn off MongoDB cacheing? We are using Redis to store active data. We plan to use redis to hold this data in a normalized way while it is being used. One of the sources that passes data into redis is a mongodb instance.

Since we are using redis to keep the data in memory c开发者_StackOverflow社区an we turn off mongos cacheing features?

Thanks!


MongoDB uses memory-mapped I/O, this means that the OS caches the data not the datababase and it's not possible to turn this caching off.

The OS tipically uses least-recently-used algorithm to drop cache if memory is needed, so if you don't request old data from MongoDB those pages are going to be freed, which means it won't really interfere with Redis.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号