moco
moco copied to clipboard
Disable binlog during restore
What
Enabling binlog output during restoration slows down the process. It is better to disable binlog during the restore and enable binlog after the restore is complete.
How
Disable binlog during restoration and re-enable binlog after the restoration completes.
Consider the following parameters for further optimization.
skip-innodb_doublewrite
innodb_flush_log_at_trx_commit = 0
innodb_flush_method = O_DIRECT_NO_FSYNC
Checklist
- [ ] Finish implementation of the issue
- [ ] Test all functions
- [ ] Have enough logs to trace activities
- [ ] Notify developers of necessary actions
While reading restore.go, I noticed that the option -skipBinlog=true was included. Thus, binlog was disabled during the restore. https://github.com/cybozu-go/moco/blob/539a90d2e329589f4d05612080584a30820b32b3/pkg/bkop/restore.go#L36