dell r620 雙顆CPU,單核心是12核心,內存是72G ,硬盤僞sata接口的企業級的SSD固態硬盤:500Gmysql
固態盤型號以下:ios
PD Type: SATA Raw Size: 465.761 GB [0x3a386030 Sectors] Inquiry Data: S3Z3NB0K116201W Samsung SSD 860 EVO 500GB RVT01B6Q Device Speed: 6.0Gb/s
測試項目:使用xtrabackup 備份100G的數據使用的時間sql
xtrabckup備份工具安裝此處忽略dom
受權xtrabackup 備份數據時登陸庫的用戶:ide
grant reload,lock tables,process,replication client,super on *.* to backupuser@'127.0.0.1' identified by '654321ccs';flush privileges;
測試使用xtrabackup 單線程備份100G的數據使用的時間是17分39秒工具
備份命令:性能
[root@localhost ~]# time innobackupex --defaults-file=/etc/my.cnf -ubackupuser -p654321ccs --host=127.0.0.1 -S /tmp/mysql3306.sock --no-timestamp 190812 16:40:52 Finished backing up non-InnoDB tables and files 190812 16:40:52 [00] Writing /data/backup/db_3306_20190812/xtrabackup_binlog_info 190812 16:40:52 [00] ...done 190812 16:40:52 Executing FLUSH NO_WRITE_TO_BINLOG ENGINE LOGS... xtrabackup: The latest check point (for incremental): '143003390816' xtrabackup: Stopping log copying thread. .190812 16:40:52 >> log scanned up to (143003390816) 190812 16:40:52 Executing UNLOCK TABLES 190812 16:40:52 All tables unlocked 190812 16:40:52 [00] Copying ib_buffer_pool to /data/backup/db_3306_20190812/ib_buffer_pool 190812 16:40:52 [00] ...done 190812 16:40:52 Backup created in directory '/data/backup/db_3306_20190812/' MySQL binlog position: filename 'mysql-bin.000060', position '324009766' 190812 16:40:52 [00] Writing /data/backup/db_3306_20190812/backup-my.cnf 190812 16:40:52 [00] ...done 190812 16:40:52 [00] Writing /data/backup/db_3306_20190812/xtrabackup_info 190812 16:40:52 [00] ...done xtrabackup: Transaction log of lsn (143003390806) to (143003390816) was copied. 190812 16:40:52 completed OK! real 17m39.710s user 6m23.436s sys 2m19.513s
從zabbix上查看監控磁盤io的使用率以下:
測試
**從zabbix上查看監控磁盤io的使用率剛超過設定的閾值50%,不到60%,同時每秒的磁盤寫入量以下:
ui
也就是此時採用3個線程並行備份數據剛恰好。磁盤的io繁忙度能夠接受線程
測試使用xtrabackup 開啓3個線程備份100G的數據使用的時間是9分44秒:
time innobackupex --defaults-file=/etc/my.cnf -ubackupuser -p123456ccs --host=127.0.0.1 -S /tmp/mysql3306.sock --parallel=3 --no-timestamp /data/backup/db_3306_`date +%Y%m%d`
190812 16:55:07 Finished backing up non-InnoDB tables and files 190812 16:55:07 [00] Writing /data/backup/db_3306_20190812/xtrabackup_binlog_info 190812 16:55:07 [00] ...done 190812 16:55:07 Executing FLUSH NO_WRITE_TO_BINLOG ENGINE LOGS... xtrabackup: The latest check point (for incremental): '143003390816' xtrabackup: Stopping log copying thread. .190812 16:55:07 >> log scanned up to (143003390816) 190812 16:55:07 Executing UNLOCK TABLES 190812 16:55:07 All tables unlocked 190812 16:55:07 [00] Copying ib_buffer_pool to /data/backup/db_3306_20190812/ib_buffer_pool 190812 16:55:07 [00] ...done 190812 16:55:07 Backup created in directory '/data/backup/db_3306_20190812/' MySQL binlog position: filename 'mysql-bin.000060', position '324017447' 190812 16:55:07 [00] Writing /data/backup/db_3306_20190812/backup-my.cnf 190812 16:55:07 [00] ...done 190812 16:55:07 [00] Writing /data/backup/db_3306_20190812/xtrabackup_info 190812 16:55:07 [00] ...done xtrabackup: Transaction log of lsn (143003390816) to (143003390816) was copied. 190812 16:55:07 completed OK! real 9m44.015s user 5m26.039s sys 2m26.201s
說明在使用3個線程備份數據時,已是達到了SSD固態盤io寫入的極限。不可能再快了
同時備份期間查看iostat命令查看SSD磁盤 設備:sdb 的已是100%繁忙了。達到了磁盤寫入性能的極限。
[root@localhost backup]# iostat -d -x -k 2 30 Linux 3.10.0-327.el7.x86_64 (localhost.localdomain) 08/12/2019 _x86_64_ (32 CPU) Device: rrqm/s wrqm/s r/s w/s rkB/s wkB/s avgrq-sz avgqu-sz await r_await w_await svctm %util sdb 0.00 0.57 0.34 3.26 42.53 256.11 166.31 0.05 13.46 38.31 10.90 0.26 0.09 sda 0.00 0.27 0.00 1.35 0.06 9.31 13.84 0.00 1.54 0.51 1.54 0.13 0.02 Device: rrqm/s wrqm/s r/s w/s rkB/s wkB/s avgrq-sz avgqu-sz await r_await w_await svctm %util sdb 0.00 1.50 1040.00 1674.50 132442.00 213625.50 254.98 224.57 83.06 46.46 105.79 0.37 100.00 sda 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 。。。。。。。。。。。。。。。。 Device: rrqm/s wrqm/s r/s w/s rkB/s wkB/s avgrq-sz avgqu-sz await r_await w_await svctm %util sdb 0.00 1.00 1294.00 1417.00 164846.00 180440.75 254.73 202.51 74.50 43.77 102.56 0.37 100.00 sda 0.00 0.00 0.00 4.00 0.00 16.25 8.12 0.00 0.75 0.00 0.75 0.75 0.30 Device: rrqm/s wrqm/s r/s w/s rkB/s wkB/s avgrq-sz avgqu-sz await r_await w_await svctm %util sdb 0.00 2.00 1616.50 1366.00 206328.00 174046.25 255.07 223.71 75.18 47.35 108.12 0.34 100.00 sda 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
從zabbix上查看監控磁盤io的使用率已是100%,磁盤的寫入和讀取基本都在185M/s
這個已是達到次SSD盤的io性能的極限了。
測試使用xtrabackup 開啓4個線程備份100G的數據使用的時間是9分58秒:
time innobackupex --defaults-file=/etc/my.cnf -ubackupuser -p123456ccs --host=127.0.0.1 -S /tmp/mysql3306.sock --parallel=4 --no-timestamp /data/backup/db_3306_`date +%Y%m%d` 190812 17:11:55 Finished backing up non-InnoDB tables and files 190812 17:11:55 [00] Writing /data/backup/db_3306_20190812/xtrabackup_binlog_info 190812 17:11:55 [00] ...done 190812 17:11:55 Executing FLUSH NO_WRITE_TO_BINLOG ENGINE LOGS... xtrabackup: The latest check point (for incremental): '143003390816' xtrabackup: Stopping log copying thread. .190812 17:11:55 >> log scanned up to (143003390816) 190812 17:11:55 Executing UNLOCK TABLES 190812 17:11:55 All tables unlocked 190812 17:11:55 [00] Copying ib_buffer_pool to /data/backup/db_3306_20190812/ib_buffer_pool 190812 17:11:55 [00] ...done 190812 17:11:55 Backup created in directory '/data/backup/db_3306_20190812/' MySQL binlog position: filename 'mysql-bin.000060', position '324048095' 190812 17:11:55 [00] Writing /data/backup/db_3306_20190812/backup-my.cnf 190812 17:11:55 [00] ...done 190812 17:11:55 [00] Writing /data/backup/db_3306_20190812/xtrabackup_info 190812 17:11:55 [00] ...done xtrabackup: Transaction log of lsn (143003390816) to (143003390816) was copied. 190812 17:11:55 completed OK! real 9m58.171s user 5m12.634s sys 2m43.506s