MongoDb 3.2中的压缩不起作用

时间:2016-08-26 21:11:53

标签: mongodb

我安装了MongoDb 3.2,并在mongodb配置文件中配置了snappy压缩:

   engine: wiredTiger
   wiredTiger:
       engineConfig:
           cacheSizeGB: 99
           journalCompressor: none
       collectionConfig:
           blockCompressor: snappy
       indexConfig:
           prefixCompression: true

但是我认为压缩实际上并不起作用,因为我可以看到集合中的平均对象大小大致相同(我在配置更改和服务重启后立即用相同的对象从头开始创建集合):

  • MMAPv1无压缩avgObjSize:5kb
  • WiredTiger snappy avgObjSize:4kb
  • WiredTiger zlib avgObjSize:4kb

当我在集合上运行统计数据时,这就是我所看到的“snappy”:

"compression" : {
        "compressed pages read" : NumberInt(0), 
        "compressed pages written" : NumberInt(5), 
        "page written failed to compress" : NumberInt(0), 
        "page written was too small to compress" : NumberInt(4), 
        "raw compression call failed, additional data available" : NumberInt(0), 
        "raw compression call failed, no additional data available" : NumberInt(0), 
        "raw compression call succeeded" : NumberInt(0)
    },

表示zlib:

{
    "compressed pages read" : NumberInt(0), 
    "compressed pages written" : NumberInt(1), 
    "page written failed to compress" : NumberInt(0), 
    "page written was too small to compress" : NumberInt(3), 
    "raw compression call failed, additional data available" : NumberInt(0), 
    "raw compression call failed, no additional data available" : NumberInt(1), 
    "raw compression call succeeded" : NumberInt(2)
}

不确定如何阅读此信息,并且不确定如何检测压缩有什么问题。

我还应该说每个场景中只有少数(如10个)对象。准确测量平均物体压缩比是否足够?

0 个答案:

没有答案