[SERVER-41268] snappy compression of mongoDB does not work. Created: 22/May/19  Updated: 27/Oct/23  Resolved: 23/May/19

Status: Closed
Project: Core Server
Component/s: Storage, WiredTiger
Affects Version/s: 4.0.9
Fix Version/s: None

Type: Question Priority: Major - P3
Reporter: J Assignee: Kevin Adistambha
Resolution: Works as Designed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
Participants:

 Description   

I used Ubuntu 16.04TLS, MongoDB 4.0.9

When I create each collection:

snappy+false
mongoshell>> db.createCollection( "test",{storageEngine:{wiredTiger:

{configString:'block_compressor=snappy, prefix_compression=false'}

}})

 

zlib+false
>mongoshell>> db.createCollection( "test",{storageEngine:{wiredTiger:

{configString:'block_compressor=zlib, prefix_compression=false'}

}})

 

I insert similar 100KB data.

total = 100KB * 100,000 = about 9GB

 

                        db.test.storageSize() 

snappy+false :    10653405184        

zlib+false :           6690177024    

 

'zlib' is compressed about 37% but 'snappy' is same the 'none'.

It was not compressed.

prefix_compress was not compressed either.

Maybe the problem is this but I do not know why.

snappy+false & snappy+true

"compression" : {
"compressed pages read" : 0,
"compressed pages written" : 0,
"page written failed to compress" : 100007,
"page written was too small to compress" : 1025
}



 Comments   
Comment by Kevin Adistambha [ 23/May/19 ]

Hi null-fiy

I believe you are posting the same question on a mongodb-user mailing list thread. I have replied to the question on mongodb-user, where I mentioned that the inability of snappy to compress your test data could be because you are using a random string. Zlib can still somewhat compress it because it focuses on compression performance and will put in a lot more effort. In contrast, snappy was designed with speed in mind.

However, if you are not using a random string as test data, we would be interested in seeing some example of your incompressible documents.

Please note that the SERVER project is for bugs and feature suggestions for the MongoDB server. As this ticket does not appear to a bug, I will now close it. If you need further assistance troubleshooting, I encourage you to ask our community by posting on the mongodb-user group or on Stack Overflow with the mongodb tag.

Best regards,
Kevin

Generated at Thu Feb 08 04:57:16 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.