Does percona-xtrabackup has any feature to estimate backup time and size for large MySQL instance? Also how to perform backup validity after taking MySQL backup with xtrabackup?
MySQL server 8.0.22
Percona Xtrabackup 8.0
CentOS 7
Hi @Rudrojit,
xtrabackup does not have such a feature because this is nearly impossible to calculate. The speed of your backup depends on MANY factors: How much data are you baking up, CPU speeds, number of CPUs/cores, speed and throughput of disks, (or speed of network if streaming to another server/cloud), using compression, parallel compression, single-thread, multi-thread. Hopefully you get the picture.
The best estimate you can make is by testing the write speed of your disks and divide your DB side by that. So, if you can write 200MB/sec and you have a 325GB database, that’s a minimum of 27.7 minutes assuming no other activity is taking place on the server.
You should always check the exit code of xtrabackup. Anything non-zero indicates a problem taking the backup. For validation, you’ll need to restore the backup to a new server and check the data. A simple SELECT * of every table will verify that every row can be read from disk.
@matthewb Thanks for the prompt response, I am actually configuring backup of a 4TB MySQL instance and was trying to figure out the backup size after --stream=xbstream --compress | gzip - > /path-to-bkp/file.xbstream.gz, which would be ideally less than the actual size. I guess there is no easy way.