Add restore parallel

This commit is contained in:
fogelito
2023-08-16 16:35:24 +03:00
parent 0bf709a0da
commit 7c3daf2df3
2 changed files with 5 additions and 4 deletions
+3 -3
View File
@@ -100,7 +100,7 @@ class Backup extends Action
public function start(): void
{
$start = microtime(true);
$time = date('Y_m_d-H_i_s');
$time = date('Y_m_d_H_i_s');
$this->filename = $time . '.xbstream';
self::log('--- Backup Start ' . $time . ' --- ');
@@ -141,12 +141,12 @@ class Backup extends Action
'--backup',
'--stream=xbstream',
'--strict',
'--history=' . $this->database, // logs PERCONA_SCHEMA.xtrabackup_history name attribute
'--history="' . $this->database . '|' . pathinfo($this->filename, PATHINFO_FILENAME) . '"', // PERCONA_SCHEMA.xtrabackup_history
'--slave-info',
'--safe-slave-backup',
'--safe-slave-backup-timeout=300',
'--check-privileges', // checks if Percona XtraBackup has all the required privileges.
'--target-dir=./',
'--target-dir=' . self::BACKUPS_PATH,
'--compress=' . self::COMPRESS_ALGORITHM,
'--compress-threads=' . $this->processors,
'--parallel=' . intval($this->processors / 2),
+2 -1
View File
@@ -166,6 +166,7 @@ class Restore extends Action
$args = [
'xtrabackup',
'--prepare',
'--parallel=' . intval($this->processors / 2),
'--strict',
'--target-dir=' . $target,
'2> ' . $logfile,
@@ -197,9 +198,9 @@ class Restore extends Action
'xtrabackup',
'--move-back',
'--strict',
'--parallel=' . intval($this->processors / 2),
'--target-dir=' . $target,
'--datadir=' . $datadir,
'--parallel=' . $this->processors,
'2> ' . $logfile,
];