TIDB BR物理备份限流观察

关键参数

--ratelimit

  • 参数值:int

  • 单位:MB

数据大小约:600 MB

一、备份测试

1.1 备份不限流

  • 消耗了 10

  • 平均速度:44.97 MB

[tidb@tikv1 ~]$ /data/tidb-tools/bin/br backup full --pd "10.25.21.21:2379" --storage "local:///backup/2021-02-08" --log-file /tmp/backup.log
Detail BR log in /tmp/backup.log
Full backup <------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> 100.00%
Checksum <---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> 100.00%
[2021/02/08 16:23:44.963 +08:00] [INFO] [collector.go:60] ["Full backup Success summary: total backup ranges: 20, total success: 20, 
total failed: 0, total take(Full backup time): 10.772693167s, total take(real time): 11.792666563s, total kv: 4000000, total size(MB): 484.45, avg speed(MB/s): 44.97"] 
["backup checksum"=916.569944ms] ["backup fast checksum"=4.232758ms] ["backup total regions"=30] [BackupTS=422778663918108673] [Size=217776231]

1.2 备份限流

  • 消耗了 40

  • 平均速度:11.92 MB

[tidb@tikv1 ~]$ /data/tidb-tools/bin/br backup full --pd "10.25.21.21:2379" --storage "local:///backup/2021-02-08" --ratelimit 3 --log-file /tmp/backup.log
Detail BR log in /tmp/backup.log
Full backup <------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> 100.00%
Checksum <---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> 100.00%
[2021/02/08 16:27:34.586 +08:00] [INFO] [collector.go:60] ["Full backup Success summary: total backup ranges: 20, total success: 20, total failed: 0, 
total take(Full backup time): 40.657958052s, total take(real time): 41.644286582s, total kv: 4000000, total size(MB): 484.45, avg speed(MB/s): 11.92"] 
["backup checksum"=880.506117ms] ["backup fast checksum"=2.855146ms] ["backup total regions"=30] [Size=217776231] [BackupTS=422778716281372674]

1.3 资源使用限流比较

  • 第一个断崖指标是全量备份不限流

  • 第二个断崖指标是全量备份限流 3 MB

可以看出来,对服务器资源使用是小一点。不过对与限流与不限流没有特别大的却别,我的理解是本文测试 TIDB 集群数据少,同时 TIDB 没有对外提供服务,还有测试 TIDB 集群的宿主机服务器性能本身就比较弱。

二、恢复测试

2.1 恢复不限流

  • 消耗了 32

  • 平均速度:14.9 MB

[tidb@tikv1 ~]$ /data/tidb-tools/bin/br restore full --pd "10.25.21.21:2379" --storage "local:///backup/2021-02-08" --log-file /tmp/restore.log
Detail BR log in /tmp/restore.log 
Full restore <-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------> 100.00%
[2021/02/08 16:37:28.145 +08:00] [INFO] [collector.go:60] ["Full restore Success summary: total restore files: 21, total success: 21, total failed: 0, 
total take(Full restore time): 32.518183569s, total take(real time): 19.627638591s, total kv: 4000000, total size(MB): 484.45, avg speed(MB/s): 14.90"] ["split region"=1.557988641s] 
["restore checksum"=18.302090921s] ["restore ranges"=20] [Size=217776231]

2.2 恢复限流

  • 消耗了 381

  • 平均速度:1.27 MB

[tidb@tikv1 ~]$ /data/tidb-tools/bin/br restore full --pd "10.25.21.21:2379" --storage "local:///backup/2021-02-08" --ratelimit 3 --log-file /tmp/restore.log
Detail BR log in /tmp/restore.log
Full restore <-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------> 100.00%
[2021/02/08 16:41:45.525 +08:00] [INFO] [collector.go:60] ["Full restore Success summary: total restore files: 21, total success: 21, total failed: 0, 
total take(Full restore time): 6m21.882170846s, total take(real time): 3m15.082066853s, total kv: 4000000, total size(MB): 484.45, avg speed(MB/s): 1.27"] ["split region"=161.496906ms] 
["restore checksum"=3m13.823566167s] ["restore ranges"=20] [Size=217776231]

2.3 资源使用限流比较

  • 第一个断崖指标是全量恢复不限流

  • 第二个相对平稳指标是全量恢复限流 3 MB

恢复数据时限流还有有一定的效果的

  • 限流一般用与对线上生产环境进行单库、单表进行恢复时。避免占用大量 CPU、IOPS 影响线上应用正常使用

「点点赞赏,手留余香」

    还没有人赞赏,快来当第一个赞赏的人吧!
数据库
DevOps
0 条回复 A 作者 M 管理员
    所有的伟大,都源于一个勇敢的开始!
欢迎您,新朋友,感谢参与互动!欢迎您 {{author}},您在本站有{{commentsCount}}条评论