简体   繁体   English

升级到MongoDB 3.0 Wired Tiger仍然可以正确向MMS报告数据大小吗?

[英]Does the upgrade to MongoDB 3.0 Wired Tiger still report data size correctly to MMS?

I'm curious as to why my MMS is suddenly showing a rapid data growth since I've upgraded to Mongo 3.0 (Wired Tiger storage engine). 我很好奇为什么自升级到Mongo 3.0(有线Tiger存储引擎)以来,我的MMS突然显示出快速的数据增长。 The slope of the new growth the past couple weeks directly correlates with the upgrade. 过去几周新增长的斜率与升级直接相关。 There are only a couple collections in this database that have over 500 documents...though these are both huge collections, the document structure has remained the same before an after the upgrade. 该数据库中只有几个馆藏有500多个文档...尽管它们都是巨大的馆藏,但升级前后的文档结构保持不变。 Also running aggregations on these collections indicate that the number of inserts has not changed on average before/after the upgrade. 在这些集合上运行聚合还表明,在升级之前/之后,插入次数平均没有变化。 This leads me to question whether the data size is being calculated differently with the new WiredTiger engine or something of that matter. 这使我怀疑使用新的WiredTiger引擎对数据大小的计算是否有所不同或类似的问题。 Does anyone have any information on this? 有人对此有任何信息吗? Here is an image of my MMS data. 这是我的MMS数据的图像。

在此处输入图片说明

A couple things, there are 2 jumps in size...these are times when I migrated a collection over from another database to mongo. 有两件事,大小有2个跳跃……这些时候是我将集合从另一个数据库迁移到mongo的时候。 Still after both of these the growth rate remained consistent and only increased after the upgrade. 在这两个方面之后,增长率仍保持不变,并且仅在升级后才增加。 The data size decreased at the upgrade (consistent with they hypothesis that Wired Tiger has compression) but has been growing so quickly that it has almost reached it's original size. 升级时,数据大小减小了(与他们的假设一致,即Wired Tiger具有压缩功能),但增长如此之快,以至于几乎达到了其原始大小。 Even the Storage Size has started growing much faster than it originally did, though this image doesn't do it justice. 即使此存储大小已开始以比原始速度快得多的速度增长,尽管此映像并不能完全做到这一点。

The data size in WiredTiger and in MMapV1 is going to be largely the same, or at least quite similar. WiredTiger和MMapV1中的数据大小将基本相同,或者至少非常相似。 Your documents are still the same size (mmapv1 may report some additional padding, but wiredtiger will only report actual data size). 您的文档大小仍然相同(mmapv1可能会报告一些附加的填充,但是wiretiger只会报告实际的数据大小)。

What will be significantly different because of compression of data on disk by Wired Tiger is the "storageSize". 由于Wired Tiger压缩了磁盘上的数据,因此将有显着不同的是“ storageSize”。 If the data size is growing, it's because your actual data is growing - that can be seen in "average object size" increasing as well. 如果数据大小在增长,那是因为您的实际数据在增长-这也可以从“平均对象大小”的增长中看出。

Looking at this further, I think that this has to do with the PHP Mongo Driver 1.5.0 update, specifically the mongo.native_long setting being defaulted to TRUE in this version and greater. 进一步来看,我认为这与PHP Mongo Driver 1.5.0更新有关,特别是mongo.native_long设置在此版本及更高版本中默认为TRUE。 Because Mongo 3.0 required greater than version 1.4 (which I was running) I had to upgrade the driver at the same time. 因为Mongo 3.0需要的版本高于1.4(我正在运行),所以我必须同时升级驱动程序。 Doing this caused all integers in new documents to be stored as LONG type which which is twice the size. 这样做会使新文档中的所有整数都存储为LONG类型,这是大小的两倍。 There's no reason for me to be storing all of my ints this way, especially when many are single digits. 我没有理由以这种方式存储所有int,尤其是当许多是个位数时。

I've changed the native_long setting to 0 and have confirmed that is is again storing everything as a 32 bit integer by default. 我将native_long设置更改为0,并确认默认情况下再次将所有内容存储为32位整数。 I assume that over the next few days I will see a decline in the rate of growth. 我认为在接下来的几天里,我的增长率将会下降。 I'll update this after a few days with the results. 几天后,我将更新结果。

Update: 更新:

The reason the size of the db was increasing was simply because it actually WAS increasing. 数据库大小增加的原因仅仅是因为它实际上在增加。 I reviewed all 100 collections on a case by case basis over the period of a week, found the one that was causing the growth and examined it to find that there were significant numbers of rows being added and that this has nothing to do with the upgrade to 3.0. 我在一周的时间内逐案检查了所有100个集合,找到了导致增长的集合,并对其进行了检查,发现其中添加了大量行,而这与升级无关到3.0。 This issue was a mere coincidence and after 7 months since this post I have no reason to believe that 3.0 reports size incorrectly to MMS. 这个问题仅仅是巧合,自从发布此帖子以来的7个月后,我没有理由相信3.0会错误地向MMS报告大小。 Further, there is no reason to believe that the exponential growth resulted from the size of integers as 64 bit. 此外,没有理由相信指数增长是由于整数大小为64位引起的。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM