MongoDB索引/RAM关系 [英] MongoDB index/RAM relationship

查看:73
本文介绍了MongoDB索引/RAM关系的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我将为一个新项目采用MongoDB,并且我选择它是出于灵活性而不是可伸缩性,因此它将在一台机器上运行.从文档和Web帖子中,我一直读到所有索引都在RAM中.这对我来说没有任何意义,因为我的索引将轻易大于可用RAM的数量.

I'm about to adopt MongoDB for a new project and I've chosen it for flexibility, not scalability so will be running it on one machine. From the documentation and web posts I keep reading that all indexes are in RAM. This just isn't making sense to me as my indexes will easily be larger than the amount of available RAM.

任何人都可以对索引/RAM的关系分享一些见识吗?当单个索引和我所有的索引都超过可用RAM的大小时会发生什么?

Can anyone share some insight on the index/RAM relationship and what happens when both an individual index and all of my indexes exceed the size of available RAM?

推荐答案

MongoDB将其能保留的索引保留在RAM中.它们将以LRU交换.您会经常看到建议您将工作集"保留在内存中的文档:如果您实际访问的索引部分适合内存,那么您会没事的.

MongoDB keeps what it can of the indexes in RAM. They'll be swaped out on an LRU basis. You'll often see documentation that suggests you should keep your "working set" in memory: if the portions of index you're actually accessing fit in memory, you'll be fine.

这篇关于MongoDB索引/RAM关系的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆