Mysqlpump is a logical backup tool that is unique to the mysql5.7.8 version, with more features than Mysqldump and Mysqldumper,mysqlpump, as described in the official documentation:
mysqlpump features include: parallel processing of databases, and of objects within databases, to speed up the dump process Better control over which databases and database objects (tables, stored programs, user accounts) to dump dumping of user accounts as account-management statements (CREATE USER , grant) rather thanas inserts into the mysql system database Capability of creating compressed output Progress indicator (The values are estimates) for dump file reloading, faster secondary index creation for InnoDB tables by adding indexes after Rows are inserted
1, support multi-process backup database and database objects, speed up the backup process.
2, have a better control strategy to back up the database and database objects (tables, stored procedures, accounts).
3. The backup user manages SQL (create User,grant) through the account and is no longer the way to insert records into the MySQL system library
4. Ability to create compressed files
5. Display progress (estimated value)
6, Reload (Restore) The backup file, the first table after the insertion of data finally indexed, reduce the index maintenance overhead, speed up the restore speed.
To test the performance of the Mysqlpump, a small test was done on its own virtual machine,
To test the virtual machine environment:
Host:
Cpu:intel (R) core (TM) i5-6400 CPU @ 2.70GHz 4 Core
Memory: 1G
Disk:SCSI hard disk 10G
Database:
Version: 5.7.16
To prepare the test data with Sysbench, here is the test data preparation script:
[[EMAIL PROTECTED] SHELL]# CAT TEST_SYSBENCH.SH #!/BIN/SHSYSBENCH --TEST=OLTP --mysql-host=192.168.110.100 --mysql-port=3307 --mysql-user=root --mysql-password=root --mysql-db=sbtest2 --oltp-num-tables=4 --oltp-table-size=500000 --report-interval=100 --max-requests=0 --oltp-test-mode=nontrx --oltp-nontrx-mode=select --oltp-read-only =off --max-time=30 --num-threads=16 prepare sysbench --test=oltp --mysql-host= 192.168.110.100 --mysql-port=3307 --mysql-user=root --mysql-password=root --mysql-db= sbtest3 --oltp-num-tables=4 --oltp-table-size=500000 --report-interval=100 -- max-requests=0 --oltp-test-mode=nontrx --oltp-nontrx-mode=select --oltp-read-only=off -- max-time=30 --num-threads=16 prepare sysbench --test=oltp --mysql-host= 192.168.110.100 --mysql-port=3307 --mysqL-user=root --mysql-password=root --mysql-db=sbtest4 --oltp-num-tables=4 --oltp-table-size =500000 --report-interval=100 --max-requests=0 --oltp-test-mode=nontrx -- Oltp-nontrx-mode=select --oltp-read-only=off --max-time=30 --num-threads=16 prepare
The
Test results are as follows:
Shell>time mysqlpump -uroot -proot -s /mysqldata/mysql/mysql3307/mysql3307.sock -A --single-transaction --default-parallelism=1 > pump.sqlreal 0m46.317suser 0m13.602ssys 0m3.949sshell>time mysqlpump -uroot -proot -s /mysqldata/mysql/mysql3307/mysql3307.sock -a -- single-transaction --default-parallelism=2 > pump.sqlreal 0m48.707suser 0m15.087ssys 0m3.965sshell>time mysqlpump -uroot -proot -s /mysqldata/mysql/mysql3307/mysql3307.sock -a -- single-transaction --default-parallelism=4 > pump.sqlreal 0m55.529suser 0m14.783ssys 0m4.143sshell>time mysqldump -uroot -proot -s /mysqldata/mysql/mysql3307/mysql3307.sock --set-gtid-purged=off -a --single-transaction > dump.sqlreal 0m57.089suser 0m8.870ssys 0m3.441s
From the test results, you can find:
1, Mysqlpump is indeed higher than mysqldump efficiency.
2, but because the test machine disk IO is limited, resulting in the number of concurrent threads from 1 to 2 and 4, due to the bottleneck of Io, backup time is more.
3, because the test database table data is small, the test data is distorted, it is recommended to prepare more than a few libraries and large tables of data for testing, the effect will be more obvious.
This article is from the "thick Product Thin Hair" blog, please make sure to keep this source http://1057212.blog.51cto.com/1047212/1910156
mysql5.7 Logical Backup tool mysqlpump