mongodb 的 mmap 和wiredtiger 引擎对比.实现对比

mongodb mmap引擎文件页管理交由操作系统 mmap 来管理.

https://www.quora.com/How-is-a-read-query-processed-in-MongoDB

How is a read query processed in MongoDB?

Does it work  like RDBMS ? for example   In mysql , query performance work at three main points
                                       Buffer pool
                                       block size
                                       Indexes
In MongoDb i saw only Indexes , But i am not able to find how mongoDB work with two cases (Bufferpool and Block) .Would  any body please provide me links where  i find  how mongodb work for read and write ?

答:

In v3.0+, storage engines are pluggable, so the answer will depend on the storage engine.

With the legacy mmap storage engine, the first two things you mentions are auto-configured / implied by the virtual memory manager because of the use of mmap, so you don't have to specify anything there.
(phil 前两项都是由操作系统管理. 说明 mmap 引擎的索引保持的是文件的 offset .不然还得重新查询到 offset . 这个又 mysql 的 myisam 有点像. 不然就需要既要维护 mmap,又要维护 内容 page的存储结构, 用来 快速查询 id 对应的 offset )

 innodb自己维护 pool ,操作系统维护 pool 的好处. 当然每个 page 缓存可能是跳过内核态的

As another example, you can find the configuration settings for the WildTiger storage engine here:Configuration File Options.
Regardless of storage engine there are indexes and conceptually this is similar to other databases.


WildTiger可以选择 btree 搜索和 lsm 索引

https://raw.githubusercontent.com/wiki/wiredtiger/wiredtiger/attachments/LSM_btree_Throughput.png



结论:  wiredtiger 在 写并发(写锁占用)和内存占用上都远远优于了 mmap . rocket mq 最初也是用 mmap,当内存不够用时, 就会出现卡顿的现象.  原因?


https://stackoverflow.com/questions/37985134/how-to-choose-from-mmapv1-wiredtiger-or-in-memory-storageengine-for-mongodb

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值