mongodb 压缩——3.0+支持zlib和snappy
转自:https://scalegrid.io/blog/enabling-data-compression-in-mongodb-3-0/
MongoDB 3.0 with the wired tiger storage engine enables you to transparently compress the data stored in your database. This is a fairly exciting and useful feature that can be used to reduce the disk space usage of your fast growing data. By default wired tiger uses the ‘Snappy’ block compression engine for all the collections. You can turn off compression by default using the following options in the mongodb server config file .
storage:
engine: wiredTiger
wiredTiger:
collectionConfig:
blockCompressor: none
The compression algorithm can be specified at the collection level during cluster creation. Here is an example of creating a collection with ‘zlib’ compression
db.createCollection( "test", {storageEngine:{wiredTiger:{configString:'block_compressor=zlib'}}} );
MongoDB wiredtiger storage engine provides two options for compression – snappy and zlib. There is essentially a tradeoff between the extent of compression and the amount of CPU load to decompress. ‘Zlib’ achieves a lot more compression and is correspondingly less performant. ‘Snappy’ aims for ‘aims for very high speeds and reasonable compression’.
We ran some simple unscientific tests to measure the compression performance. We used one of data sets storing strings which we felt would compress well. Here is the basic structure of each document.
{
'_id': <ObjectID>,
'name': <Five character string>,
'value': <Random 1MB string>
}
We inserted about 5000 of these documents (about 5GB of data). The results were fairly impressive. Zlib achieves considerable amount of compression. Snappy also achieves a fair amount of compression with little or no load on the system.
Zlib | Snappy | uncompressed | |
Data size (MB) | 5000.5 | 5000.5 | 5000.5 |
Storage size (MB) | 19.62 | 254.37 | 5019 |
As always you need to run some tests to understand the performance gains for your data set. Here are some more detailed benchmark studies on compression performance and tradeoffs
http://www.mongodb.com/blog/post/new-compression-options-mongodb-30
http://www.acmebenchmarking.com/2015/02/mongodb-v30-compression-benchmarks.htmlhttps://comerford.cc/2015/02/04/mongodb-3-0-testing-compression/
mongodb 压缩——3.0+支持zlib和snappy的更多相关文章
- 饼干是这样压缩的——PHP使用zlib扩展实现页面GZIP压缩输出
饼干是这样压缩的——PHP使用zlib扩展实现页面GZIP压缩输出 GZIP(GNU-ZIP)是一种压缩技术.经过GZIP压缩后页面大小可以变为原来的30%甚至更小.这样用户浏览的时候就会感觉很爽很愉 ...
- hadoop对于压缩文件的支持及算法优缺点
hadoop对于压缩文件的支持及算法优缺点 hadoop对于压缩格式的是透明识别,我们的MapReduce任务的执行是透明的,hadoop能够自动为我们 将压缩的文件解压,而不用我们去关心. 如果 ...
- C#5.0支持的await格式
C#5.0支持的await格式 C#5.0引入了编译器支持的 async 和 await 关键字,这就为开发者提供了使用同步思想写异步代码的方便. 但是有些传统函数仅提供了异步回调实现,如何对其封装, ...
- WebStorm 7.0 支持更多的Web技术
JetBrains刚刚发布了WebStorm 7.0 GA,支持EJS.Mustache.Handlebars.Web组件.Stylus.Karma.Istanbul.Compass,并增强了很多功能 ...
- hadoop对于压缩文件的支持
转载:https://www.cnblogs.com/ggjucheng/archive/2012/04/22/2465580.html hadoop对于压缩格式的是透明识别,我们的MapReduce ...
- 干货来袭:Redis5.0支持的新功能说明
Redis5.0支持的新特性说明 本文内容来自华为云帮助中心 华为云DCS的Redis5.x版本继承了4.x版本的所有功能增强以及新的命令,同时还兼容开源Redis5.x版本的新增特性. Stream ...
- NoSQL Manager for MongoDB 4.6.0.3 带key
NoSQL Manager for MongoDB 4.6.0.3 是一个Windows平台的MongoDB高级管理工具.请低调使用. 博客园文件一次最大不超过10M. 官方安装包: mongodbm ...
- mongodb压缩——snappy、zlib块压缩,btree索引前缀压缩
MongoDB 3.0 WiredTiger Compression and Performance One of the most exciting developments over the li ...
- 跨平台的zip文件压缩处理,支持压缩解压文件夹
根据minizip改写的模块,需要zlib支持 输出的接口: #define RG_ZIP_FILE_REPLACE 0 #define RG_ZIP_FILE_APPEND 1 //压缩文件夹目录, ...
随机推荐
- JdbcTemplate学习笔记
JdbcTemplate学习笔记 1.使用JdbcTemplate的execute()方法执行SQL语句 Java 代码 jdbcTemplate.execute("CREATE TABLE ...
- Clock Pictures
Clock Pictures 题目描述 You have two pictures of an unusual kind of clock. The clock has n hands, each h ...
- Hibernate 系列教程5-双向多对一
主要讲解inverse和cascade的用法 cascade定义的是关系两端对象到对象的级联关系: 而inverse定义的是关系和对象的级联关系(管理外键的值). inverse 属性默认是false ...
- iOS 6 Passbook 入门 1/2
http://www.raywenderlich.com/zh-hans/23066/ios-6-passbook-%E5%85%A5%E9%97%A8-12 iOS 6 Passbook 入门 1/ ...
- javascript语句语义大全(3)
1. for(var i=0;i<10;i++){ } for循环,括号里面是循环条件,翻译过来是,初始设定1=0:没循环一次i会+1,直到i<10 2. var i=0: while(i ...
- ubuntu server 11.10 mysql 自动备份脚本
1.下载最新的备份脚本(AutoMySQLBackup) 点这里下载 2.修改脚本配置部分 vi /root/automysqlbackup-2.5.1-01.sh USERNAME=root PA ...
- java项目(java project)如何导入jar包的解决方案列表
右键项目-properties-java build path(左侧菜单)-选择libraries 有两种方式,导入jar包实际上就是建立一种链接,并不是copy式的导入 一.导入外部包,add ex ...
- 删除MySQL二进制日志
服务器上的120G SSD硬盘空间用了92%,检查后发现,原来是 MySQL的二进制日志没有及时清除,占用了大量的空间, 于是直接用命令:reset master 一把删干净了. 1 reset ma ...
- Fragment里面嵌套Fragment的问题
最近两天做项目时,要在fragment里面嵌套Fragment,最开始使用Fragment的hide,show等方法一直失败,,如图,message是一个fragment,在里面又有两个子fragme ...
- hdu_5179_beautiful number(数位DP)
题目连接:http://acm.hdu.edu.cn/showproblem.php?pid=5179 题意:给你一个范围,问你漂亮的数有多少个,漂亮的数的定义为 数位高的比数位低的大,并且 数位高的 ...