Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doc:add config for hot region history and add command for pd ctl #6627

Merged
merged 13 commits into from
Jan 20, 2022
14 changes: 14 additions & 0 deletions pd-configuration-file.md
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,20 @@ Configuration items related to scheduling
+ Controls whether to use Joint Consensus for replica scheduling. If this configuration is disabled, PD schedules one replica at a time.
+ Default value: `true`

### `hot-regions-write-interval`
TomShawn marked this conversation as resolved.
Show resolved Hide resolved

+ The time interval for PD to store hot Region information.
TomShawn marked this conversation as resolved.
Show resolved Hide resolved
+ Default value: `10m`

> **Note:**
>
>Information about the hot Region is updated every three minutes. If the interval is set to less than three minutes, updates during the interval might be meaningless.
TomShawn marked this conversation as resolved.
Show resolved Hide resolved

### `hot-regions-reserved-days`
TomShawn marked this conversation as resolved.
Show resolved Hide resolved

+ How many days the hot Region information is retained.
TomShawn marked this conversation as resolved.
Show resolved Hide resolved
+ Default value: `7`

## `replication`

Configuration items related to replicas
Expand Down
56 changes: 49 additions & 7 deletions pd-control.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ To use PD Control, execute the `tiup ctl:<cluster-version> pd -u http://<pd_ip>:

If you want to download the latest version of `pd-ctl`, directly download the TiDB package, because `pd-ctl` is included in the TiDB package.

| Package download link | OS | Architecture | SHA256 checksum |
|:---|:---|:---|:---|
| `https://download.pingcap.org/tidb-{version}-linux-amd64.tar.gz` (pd-ctl) | Linux | amd64 | `https://download.pingcap.org/tidb-{version}-linux-amd64.sha256` |
| Package download link | OS | Architecture | SHA256 checksum |
| :------------------------------------------------------------------------ | :---- | :----------- | :--------------------------------------------------------------- |
| `https://download.pingcap.org/tidb-{version}-linux-amd64.tar.gz` (pd-ctl) | Linux | amd64 | `https://download.pingcap.org/tidb-{version}-linux-amd64.sha256` |

> **Note:**
>
Expand Down Expand Up @@ -366,16 +366,58 @@ Usage:
]
```

### `hot [read | write | store]`
### `hot [read | write | store| history <start_time> <end_time> [<key> <value>]]`

Use this command to view the hot spot information of the cluster.

Usage:

```bash
>> hot read // Display hot spot for the read operation
>> hot write // Display hot spot for the write operation
>> hot store // Display hot spot for all the read and write operations
>> hot read // Display hot spot for the read operation
>> hot write // Display hot spot for the write operation
>> hot store // Display hot spot for all the read and write operations
>> hot history 1629294000000 1631980800000 // Display history hot spot for the specified period (milliseconds)
TomShawn marked this conversation as resolved.
Show resolved Hide resolved
{
"history_hot_region": [
{
"update_time": 1630864801948,
"region_id": 103,
"peer_id": 1369002,
"store_id": 3,
"is_leader": true,
"is_learner": false,
"hot_region_type": "read",
"hot_degree": 152,
"flow_bytes": 0,
"key_rate": 0,
"query_rate": 305,
"start_key": "7480000000000000FF5300000000000000F8",
"end_key": "7480000000000000FF5600000000000000F8"
},
...
]
}
>> hot history 1629294000000 1631980800000 hot_region_type read region_id 1,2,3 store_id 1,2,3 peer_id 1,2,3 is_leader true is_learner true // Display history hot spot for the specified period with more conditions
TomShawn marked this conversation as resolved.
Show resolved Hide resolved
{
"history_hot_region": [
{
"update_time": 1630864801948,
"region_id": 103,
"peer_id": 1369002,
"store_id": 3,
"is_leader": true,
"is_learner": false,
"hot_region_type": "read",
"hot_degree": 152,
"flow_bytes": 0,
"key_rate": 0,
"query_rate": 305,
"start_key": "7480000000000000FF5300000000000000F8",
"end_key": "7480000000000000FF5600000000000000F8"
},
...
]
}
```

### `label [store <name> <value>]`
Expand Down