Skip to content

Commit

Permalink
br: add ratelimit in br commands (pingcap#6606)
Browse files Browse the repository at this point in the history
  • Loading branch information
Liuxiaozhen12 authored Oct 12, 2021
1 parent a1c1a47 commit 69de650
Showing 1 changed file with 16 additions and 7 deletions.
23 changes: 16 additions & 7 deletions br/use-br-command-line-tool.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ Back up all the cluster data to the `/tmp/backup` path of each TiKV node and wri
br backup full \
--pd "${PDIP}:2379" \
--storage "local:///tmp/backup" \
--ratelimit 120 \
--ratelimit 128 \
--log-file backupfull.log
```

Expand All @@ -106,7 +106,7 @@ A progress bar is displayed in the terminal during the backup. When the progress
br backup full \
--pd "${PDIP}:2379" \
--storage "local:///tmp/backup" \
--ratelimit 120 \
--ratelimit 128 \
--log-file backupfull.log
Full Backup <---------/................................................> 17.12%.
```
Expand All @@ -126,7 +126,7 @@ br backup db \
--pd "${PDIP}:2379" \
--db test \
--storage "local:///tmp/backup" \
--ratelimit 120 \
--ratelimit 128 \
--log-file backuptable.log
```

Expand All @@ -150,7 +150,7 @@ br backup table \
--db test \
--table usertable \
--storage "local:///tmp/backup" \
--ratelimit 120 \
--ratelimit 128 \
--log-file backuptable.log
```

Expand Down Expand Up @@ -178,7 +178,7 @@ br backup full \
--pd "${PDIP}:2379" \
--filter 'db*.tbl*' \
--storage "local:///tmp/backup" \
--ratelimit 120 \
--ratelimit 128 \
--log-file backupfull.log
```

Expand Down Expand Up @@ -211,6 +211,7 @@ br backup full \
--storage "s3://${Bucket}/${Folder}" \
--s3.region "${region}" \
--send-credentials-to-tikv=true \
--ratelimit 128 \
--log-file backuptable.log
```

Expand All @@ -230,6 +231,7 @@ To back up the incremental data between `(LAST_BACKUP_TS, current PD timestamp]`
```shell
br backup full\
--pd ${PDIP}:2379 \
--ratelimit 128 \
-s local:///home/tidb/backupdata/incr \
--lastbackupts ${LAST_BACKUP_TS}
```
Expand Down Expand Up @@ -282,6 +284,7 @@ For example, you can execute the following command to back up all keys between `
br backup raw --pd $PD_ADDR \
-s "local://$BACKUP_DIR" \
--start 31 \
--ratelimit 128 \
--end 3130303030303030 \
--format hex \
--cf default
Expand Down Expand Up @@ -339,6 +342,7 @@ A progress bar is displayed in the terminal during the restoration. When the pro
br restore full \
--pd "${PDIP}:2379" \
--storage "local:///tmp/backup" \
--ratelimit 128 \
--log-file restorefull.log
Full Restore <---------/...............................................> 17.12%.
```
Expand All @@ -357,6 +361,7 @@ Restore a database backed up in the `/tmp/backup` path to the cluster.
br restore db \
--pd "${PDIP}:2379" \
--db "test" \
--ratelimit 128 \
--storage "local:///tmp/backup" \
--log-file restorefull.log
```
Expand All @@ -382,6 +387,7 @@ br restore table \
--pd "${PDIP}:2379" \
--db "test" \
--table "usertable" \
--ratelimit 128 \
--storage "local:///tmp/backup" \
--log-file restorefull.log
```
Expand Down Expand Up @@ -434,6 +440,7 @@ br restore full \
--pd "${PDIP}:2379" \
--storage "s3://${Bucket}/${Folder}" \
--s3.region "${region}" \
--ratelimit 128 \
--send-credentials-to-tikv=true \
--log-file restorefull.log
```
Expand All @@ -453,7 +460,7 @@ When you restore data using BR, the tables created in the `mysql` schema are not
{{< copyable "shell-regular" >}}
```shell
br restore full -f '*.*' -f '!mysql.*' -f 'mysql.usertable' -s $external_storage_url
br restore full -f '*.*' -f '!mysql.*' -f 'mysql.usertable' -s $external_storage_url --ratelimit 128
```
In the above command, `-f '*.*'` is used to override the default rules and `-f '!mysql.*'` instructs BR not to restore tables in `mysql` unless otherwise stated. `-f 'mysql.usertable'` indicates that `mysql.usertable` is required for restore. For detailed implementation, refer to the [table filter document](/table-filter.md#syntax).
Expand All @@ -463,7 +470,7 @@ If you only need to restore `mysql.usertable`, use the following command:
{{< copyable "shell-regular" >}}
```shell
br restore full -f 'mysql.usertable' -s $external_storage_url
br restore full -f 'mysql.usertable' -s $external_storage_url --ratelimit 128
```
> **Warning:**
Expand Down Expand Up @@ -492,6 +499,7 @@ br restore raw --pd $PD_ADDR \
-s "local://$BACKUP_DIR" \
--start 31 \
--end 3130303030303030 \
--ratelimit 128 \
--format hex \
--cf default
```
Expand Down Expand Up @@ -530,6 +538,7 @@ During data restoration, writing too much data affects the performance of the on
```
br restore full \
-s "local://$BACKUP_DIR" \
--ratelimit 128 \
--pd $PD_ADDR \
--online
```

0 comments on commit 69de650

Please sign in to comment.