测试mysqldump 压缩率和时间消耗

实验总结:

从本次实验数据可以看出,mysqldump通过|gzip参数可以将导出文件压缩53%,同时耗时也普通非压缩模式的2.3倍.

数据库环境:

#[root@db211_08:38:32 /data/57mysql/mysql3506/data]
#du -sch *
4.0K auto.cnf
4.0K backup-my.cnf
68K error.log
16K ib_buffer_pool
100M ibdata1
100M ib_logfile0
100M ib_logfile1
100M ib_logfile2
12M ibtmp1
4.0K innodb_status.7051
12M mysql
4.0K mysql.pid
1.1M performance_schema
4.0K relay-bin.000001
4.0K relay-bin.index
12K slow.log
676K sys
82G sysbench_testdata
15M wenyz
4.0K xtrabackup_binlog_info
4.0K xtrabackup_binlog_pos_innodb
4.0K xtrabackup_checkpoints
4.0K xtrabackup_info
502M xtrabackup_logfile
83G total

使用压缩方式使用时间及文件大小:

#time /usr/local/mysql57/bin/mysqldump -S /tmp/mysql3506.sock -pxxxx--master-data=2 --single-transaction -A|gzip >/data/backup/3506_zip.sql
mysqldump: [Warning] Using a password on the command line interface can be insecure.
Warning: A partial dump from a server that has GTIDs will by default include the GTIDs of all transactions, even those that changed suppressed parts of the database. If you don't want to restore GTIDs, pass --set-gtid-purged=OFF. To make a complete dump, pass --all-databases --triggers --routines --events. real 115m55.207s
user 128m53.269s
sys 1m25.633s
[root@db211_19:48:52 /data/backup]
#du -sh *
27G 3506_zip.sql

使用非压缩方式的时间及文件大小:

#time /usr/local/mysql57/bin/mysqldump -S /tmp/mysql3506.sock -pxxxx --master-data=2 --single-transaction -A >/backup/3506_uzip.sql
mysqldump: [Warning] Using a password on the command line interface can be insecure.
Warning: A partial dump from a server that has GTIDs will by default include the GTIDs of all transactions, even those that changed suppressed parts of ore GTIDs, pass --set-gtid-purged=OFF. To make a complete dump, pass --all-databases --triggers --routines --events. real 50m18.354s
user 16m8.894s
sys 1m48.383s
[root@db211_22:21:31 /data/57mysql/mysql3506/data]
#du -sch /backup/
57G /backup/
57G total

两者对比:

  • 导出文件大小与原数据目录对比及导出文件大小间对比:

    27/82G=33%

    57/82G=69.5%

    27/57G=47%
  • 用时对比

    115/50m=2.3倍

测试mysqldump 压缩率和时间消耗的更多相关文章

  1. JavaScript 的时间消耗--摘抄

    JavaScript 的时间消耗 2017-12-24 dwqs 前端那些事儿 随着我们的网站越来越依赖 JavaScript, 我们有时会(无意)用一些不易追踪的方式来传输一些(耗时的)东西. 在这 ...

  2. 在项目管理中如何保持专注,分享一个轻量的时间管理工具【Flow Mac版 - 追踪你在Mac上的时间消耗】

    在项目管理和团队作业中,经常面临的问题就是时间管理和优先级管理发生问题,项目被delay,团队工作延后,无法达到预期目标. 这个仿佛是每个人都会遇到的问题,特别是现在这么多的内容软件来分散我们的注意力 ...

  3. Chrome测试网站加载时间与流量消耗

    加载10M内容,耗时近10秒钟 大概页面图片下载时,同时进行了,有的大图,下载要几秒钟

  4. mysql 开发进阶篇系列 43 逻辑备份与恢复(mysqldump 的基于时间和位置的不完全恢复)

    一. 概述 在上篇讲到了逻辑备份,使用mysqldump工具来备份一个库,并使用完全恢复还原了数据库.在结尾也讲到了误操作是不能用完全恢复的.解决办法是:我们需要恢复到误操作之前的状态,然后跳过误操作 ...

  5. C# Stopwatch获取循环中某操作的时间消耗

    在C#中通常使用DateTime来表示当前时间,可以在一个操作的前后分别使用一个DateTime对象获取当前时间,再将两个DateTime对象相减获得时间差(TimeSpan对象),从而得到这个操作耗 ...

  6. 栈空间默认1M,测试存进数据时间

    #include <stdio.h> 栈空间是1024*1024,一兆1M,其中包含了进入main函数之前的1万左右空间.全空间是足的.速度:栈>全局>堆 测试运算时间.100 ...

  7. 二进制GCD算法 减少%的时间消耗

    /* 二进制求最大公约数.由于传统的GCD,使用了%,在计算机运行过程中要花费大量的时间,所以,采取二进制的求法,来减少时间的消耗. 算法: 当a,b都是偶数时: gcd(a,b)=2*gcd(a/2 ...

  8. #C++初学记录 (第一次测试)(A - 复习时间 )

    练习题目一 (A-复习时间) 为了能过个好年,xhd开始复习了,于是每天晚上背着书往教室跑.xhd复习有个习惯,在复习完一门课后,他总是挑一门更简单的课进行复习,而他复习这门课的效率为两门课的难度差的 ...

  9. 如何让Jmeter压力测试减少压力机的资源消耗

    如下是官方的一些建议: 1. 使用非gui模式,例如 jmeter -n -t test.jmx -l test.jtl 2. 尽量用较少的监听器(listeners):如果使用了-l 标致像上面一样 ...

随机推荐

  1. 【bzoj1688】[USACO2005 Open]Disease Manangement 疾病管理 状态压缩dp+背包dp

    题目描述 Alas! A set of D (1 <= D <= 15) diseases (numbered 1..D) is running through the farm. Far ...

  2. [九省联考2018]IIIDX 贪心 线段树

    ~~~题面~~~ 题解: 一开始翻网上题解看了好久都没看懂,感觉很多人都讲得不太详细,所以导致一些细节的地方看不懂,所以这里就写详细一点吧,如果有不对的or不懂的可以发评论在下面. 首先有一个比较明显 ...

  3. 牛客网 提高组第8周 T2 推箱子 解题报告

    推箱子 链接: https://ac.nowcoder.com/acm/contest/176/B 来源:牛客网 题目描述 在平面上有\(n\)个箱子,每个箱子都可以看成一个矩形,两条边都和坐标轴平行 ...

  4. bzoj1690:[Usaco2007 Dec]奶牛的旅行(分数规划+spfa判负环)

    PS:此题数组名皆引用:戳我 题目大意:有n个点m条有向边的图,边上有花费,点上有收益,点可以多次经过,但是收益不叠加,边也可以多次经过,但是费用叠加.求一个环使得收益和/花费和最大,输出这个比值. ...

  5. vector去除重复的元素

    vector<int> v; sort(v.begin(),v.end()); v.erase(unique(v.begin(), v.end()), v.end());

  6. django 给前端传递HTML内容

    django从view向template传递HTML字符串的时候,django默认不渲染此HTML,原因是为了防止这段字符串里面有恶意攻击的代码. 如果需要渲染这段字符串,需要在view里这样写: f ...

  7. Educational Codeforces Round 6 A

    A. Professor GukiZ's Robot time limit per test 0.5 seconds memory limit per test 256 megabytes input ...

  8. mybatis <where>、<set>、<trim>、<sql>、<foreach>标签的使用

    转:http://www.cnblogs.com/lixiujie/p/5766669.html <resultMap>标签的使用:这个类似于hibernte用于映射我们创建的vo对象与数 ...

  9. zigbee ---- 各种ID的作用

    EPAN ID的作用:

  10. flush priviliege

    grant all on *.* to usernmae@'%' identified by '*****'; flush privileges grant all on *.* to root@'% ...