XtraBackup Basic Questions

I have not used XtraBackup yet and have 2 questions;

Documentation refers to using posix_fadvise(), this is already set or something that needs to be set before running it?

Is there a way to control the CPU usage to minimize impact on the host? Typical CPU usage on the host is minimal but safe guards are better. Still going through the doc which may have an answer to this

1 Like

Hi @Bradley_Harker ,

Documentation refers to using posix_fadvise(), this is already set or something that needs to be set before running it?

That is done automatically by xtrabackup when reading files. For example - https://github.com/percona/percona-xtrabackup/blob/percona-xtrabackup-8.0.28-21/storage/innobase/xtrabackup/src/fil_cur.cc#L407

Is there a way to control the CPU usage to minimize impact on the host? Typical CPU usage on the host is minimal but safe guards are better. Still going through the doc which may have an answer to this

Xtrabackup is not CPU bound, it’s rather IO-bound by default. Here are a few things to consider in regards to CPU and IO:
–parallel - this parameter controls how many threads will copy data. The more threads you have, more stress you will put in your IO system
–throttle - Xtrabackup works in a pair IO operations, read 1 chunk of data from source, write this data to --target-dir. --throttle allows you to limit the amount of pair operations that can happen on a single second.
–compress - This allows you to compress you data, in this case, this will add some pressure on your CPU as it will have to compress the data
–compress-threads - this is the amount of threads that will be spawned to deal with compressed workload - more threads means compression will be faster, but more CPU will be used.
–encrypt - This allows you to encrypt your backup on the fly, same as compression, this will add some stress on your CPU
–encrypt-threads - same as compression too, more threads, faster the encryption will be with the cost of extra CPU.

1 Like