Are there any flags or tricks to speed up mysqldump
for backups? Here is what we are currently using:
mysqldump --skip-opt --flush-logs --routines --triggers --allow-keywords --create-options --add-locks --quick --single-transaction --extended-insert --all-databases --events --default-character-set=utf8 | bzip2 -c > $BACKUP_PATH/$(date +\%Y_\%m_\%d_\%H_\%M_\%S).sql.bz2
I noticed that mysqldump
is running in a single thread, even though our MySQL server has 8 cores. Currently this command takes greater more than 20 minutes to run.