MongoDb 的 WiredTiger 是否存在重新分配为 MMAPv1 的性能问题 [英] Does WiredTiger of MongoDb has the performance issue of reallocation as MMAPv1

查看:38
本文介绍了MongoDb 的 WiredTiger 是否存在重新分配为 MMAPv1 的性能问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

正如 MMAPv1 文档所说

所有记录都连续位于磁盘上,当文档变得大于分配的记录时,MongoDB 必须分配一条新记录.新分配需要 MongoDB 移动文档并更新引用该文档的所有索引,这比就地更新花费更多时间并导致存储碎片.在 3.0.0 版本中更改.
默认情况下,MongoDB 使用 2 大小分配的幂,因此 MongoDB 中的每个文档都存储在包含文档本身和额外空间或填充的记录中.填充允许文档随着更新而增长,同时最大限度地减少重新分配的可能性.

但是 WiredTiger 文档 对此一无所知.所以我只想知道当记录大小改变时是否很好,或者它有一些性能问题但在文档中没有提到.

But the WiredTiger Document says nothing about this. So I just wanna know whether it is very ok when the record size changes or it has some performance issue but doesn't mention in the document.

推荐答案

使用 WiredTiger,您不必担心文档移动、填充等问题.新写入最初写入未使用区域中的文件,然后稍后与后台的其余数据合并.在更新期间,WiredTiger 实际上会编写新版本的文档,而不是像 mmapv1 在许多情况下那样覆盖现有数据.(查看来自 MongodDB 免费在线课程的视频)

You do not have to worry about document movement, padding etc. with WiredTiger. New writes initially get written to files in unused regions and then incorporated in with the rest of the data in the background later. WiredTiger, during an update, will actually write a new version of documents rather than overriding existing data the way a mmapv1 does in many cases. (Check the video from MongodDB free online courses)

这篇关于MongoDb 的 WiredTiger 是否存在重新分配为 MMAPv1 的性能问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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