Back up a MySQL instance of about 250G "Xtrabackup backup scenario Comparison"

Source: Internet
Author: User

back up a MySQL instance of about 250GA. Using Xtrabackup Backup and gzip single-threaded compression

Time Innobackupex--user=test--password=test--socket=/home/mysqld.sock--slave-info--defaults-file=/etc/mysql/my . CNF--stream=tar/home/backup | gzip > Mysql-backup.tgz

Real 271m15.984s
User 275m44.840s
SYS 6m34.393s


Summarize:

Backup time: 6 hours 30 minutes or more
Occupying space: 87G
CPU occupied: CPU with a single core is full


Disadvantage: Long backup time, a single core CPU is full, the recovery is time-consuming decompression, because the backup time window is longer, so the apply-log time is also relatively longer
Advantages: High Compression ratio



B. Using concurrent compression with Xtrabackup

Real 8m56.112s
User 36m18.179s
SYS 4m1.395s


Summarize:

Backup time: About 10 minutes
Occupying space: 123G
CPU usage: No core CPU is full

Disadvantage: Compression ratio is not high, recovery needs to solve two times the package
Advantages: Fast backup speed, CPU core will not be full, recovery time is short, because the backup window is short, so Apply-log will be completed soon


Recovery method:

1. Unlock the Xbstream file
Time Xbstream-c/home/data/backup/-x-v < Mysql-backup.xbstream

Real 8m3.373s
User 2m49.465s
SYS 3m31.498s


2. unzip the compressed QP file

CD /home/data/backup/

Time Innobackupex--decompress--parallel=32.
Real 6m24.422s
User 17m45.832s
SYS 15m17.286s


3.apply Log

CD /home/data/backup/

Innobackupex--apply-log./


4.copy back

CD /home/data/backup/

Innobackupex--copy-back--defaults-file=/etc/mysql/my.cnf.

This step if use copy-back words will take time, there is a time-saving method is to directly apply the data MV to the need to restore the directory (transient)

For example: cd/home/data/backup/&& mv./*/home/mysqlrecover/data/

Restore time: About 25 minutes


It is worthwhile to sacrifice some space for the time to change ....



Back up a MySQL instance of about 250G "Xtrabackup backup scenario Comparison"

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.