xtrabckup工具的备份优化,添加了下面的参数
Options summary
–ftwrl-wait-timeout (seconds) - how long to wait for a good moment. Default is 0, not to wait.
–ftwrl-wait-query-type - which long queries should be finished before FLUSH TABLES WITH READ LOCK is run. Default is all.
–ftwrl-wait-threshold (seconds) - how long query should be running before we consider it long running and potential blocker of global lock.
–kill-long-queries-timeout (seconds) - how many time we give for queries to complete after FLUSH TABLES WITH READ LOCK is issued before start to kill. Default if 0, not to kill.
–kill-long-query-type - which queries should be killed once kill-long-queries-timeout has expired.
Example
Running the xtrabackup with the following options will cause xtrabackup to spend no longer than 3 minutes waiting for all queries older than 40 seconds to complete.

$ xtrabackup --backup --ftwrl-wait-threshold=40
–ftwrl-wait-query-type=all --ftwrl-wait-timeout=180
–kill-long-queries-timeout=20 --kill-long-query-type=all
–target-dir=/data/backups/
After FLUSH TABLES WITH READ LOCK is issued, xtrabackup will wait for 20 seconds for lock to be acquired. If lock is still not acquired after 20 seconds, it will kill all queries which are running longer that the FLUSH TABLES WITH READ LOCK.