设为首页 加入收藏

TOP

加快mydumper与myloader导出导入(二)
2015-11-10 12:16:59 来源: 作者: 【 】 浏览:1
Tags:加快 mydumper myloader 导出 导入
----+-------+-----------+---------+---------+--------+-----------------------------+------------------------------------------------+
| 4452079 | root? | localhost | bsom? ? | Query? |? ? ? 0 | init? ? ? ? ? ? ? ? ? ? ? ? | show processlist? ? ? ? ? ? ? ? ? ? ? ? ? ? ? |
| 4452167 | inno? | localhost | tempdb? | Sleep? |? ? 769 |? ? ? ? ? ? ? ? ? ? ? ? ? ? | NULL? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? |
| 4452168 | inno? | localhost | tempdb? | Query? |? ? 36 | update? ? ? ? ? ? ? ? ? ? ? | INSERT INTO `tb_access_log` VALUES (6367402,"0,|
| 4452169 | inno? | localhost | tempdb? | Query? |? ? 21 | Waiting for table level lock| INSERT INTO `tb_access_log` VALUES (12593865," |
| 4452170 | inno? | localhost | tempdb? | Query? |? ? 26 | Waiting for table level lock| INSERT INTO `tb_access_log` VALUES (15643029,""|
| 4452171 | inno? | localhost | tempdb? | Query? |? ? ? 6 | Waiting for table level lock| INSERT INTO `tb_access_log` VALUES (173947,"70 |
| 4452172 | inno? | localhost | tempdb? | Query? |? ? 15 | Waiting for table level lock| INSERT INTO `tb_access_log` VALUES (9490507,"7 |
| 4452173 | inno? | localhost | tempdb? | Query? |? ? 30 | Waiting for table level lock| INSERT INTO `tb_access_log` VALUES (3271602,"4 |
+---------+---------+-----------+---------+---------+--------+-----------------------------+----------------------------------------------+


c、调整myisam有关参数后导入
[root@GZ-APP-BAK01 tmp]# time myloader -u innobk -p InnoBK -B tempdb -t 6 -d /backup/tmp -v 3
** Message: 6 threads created
** Message: Creating table `tempdb`.`tb_mobile_access_log`
** Message: Thread 1 restoring `blossom`.`tb_mobile_access_log` part 3
** Message: Thread 6 restoring `blossom`.`tb_mobile_access_log` part 6
** Message: Thread 2 restoring `blossom`.`tb_mobile_access_log` part 5
** Message: Thread 3 restoring `blossom`.`tb_mobile_access_log` part 4
** Message: Thread 4 restoring `blossom`.`tb_mobile_access_log` part 1
** Message: Thread 5 restoring `blossom`.`tb_mobile_access_log` part 2
** Message: Thread 6 shutting down
** Message: Thread 5 shutting down
** Message: Thread 1 shutting down
** Message: Thread 2 shutting down
** Message: Thread 4 shutting down
** Message: Thread 3 shutting down


real? ? 266m28.903s
user? ? 0m6.008s
sys? ? 0m1.681s


###调整以下相关参数,后尝试再次导入,
concurrent_insert? AUTO 改成 ALWAYS
bulk_insert_buffer_size 8388608 改成 256M
myisam_sort_buffer_size 67108864 改成 128M


[root@GZ-APP-BAK01 tmp]# time myloader -u innobk -p InnoBK -B tempdb -t 6 -o -d /backup/tmp -v 3
** Message: 6 threads created
** Message: Dropping table (if exists) `tempdb`.`tb_mobile_access_log`
** Message: Creating table `tempdb`.`tb_mobile_access_log`
** Message: Thread 1 restoring `blossom`.`tb_mobile_access_log` part 3
** Message: Thread 2 restoring `blossom`.`tb_mobile_access_log` part 6
** Message: Thread 3 restoring `blossom`.`tb_mobile_access_log` part 5
** Message: Thread 4 restoring `blossom`.`tb_mobile_access_log` part 4
** Message: Thread 6 restoring `blossom`.`tb_mobile_access_log` part 1
** Message: Thread 5 restoring `blossom`.`tb_mobile_access_log` part 2
** Message: Thread 2 shutting down
** Message: Thread 1 shutting down
** Message: Thread 6 shutting down
** Message: Thread 5 shutting down
** Message: Thread 3 shutting down
** Message: Thread 4 shutting down


real? ? 253m42.460s? ###此时导入时间并无明显减少
user? ? 0m5.924s
sys? ? 0m1.637s


2、基于innodb引擎的导出导入
a、表未分块导出,数据文件大小为3.9GB
[root@GZAPP tmp]# ls -hltr
total 3.9G
-rw-r--r-- 1 root root 1.8K Jul 24 00:09 bscom.tb_message-schema.sql
-rw-r--r-- 1 root roo

首页 上一页 1 2 3 下一页 尾页 2/3/3
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
分享到: 
上一篇CentOS安装部署MariaDB 下一篇Oracle中删除表空间提示ORA-00604..

评论

帐  号: 密码: (新用户注册)
验 证 码:
表  情:
内  容: