Skip to content

Commit

Permalink
add calibrate resource error
Browse files Browse the repository at this point in the history
Signed-off-by: Cabinfever_B <[email protected]>
  • Loading branch information
CabinfeverB committed Jul 5, 2023
1 parent 66acaa9 commit bd9bda9
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
2 changes: 2 additions & 0 deletions dashboard/dashboard-resource-manager.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ Before resource planning, you need to know the overall capacity of the cluster.

- When the workload within the time window is too low, the following error is displayed `ERROR 1105 (HY000): The workload in selected time window is too low, with which TiDB is unable to reach a capacity estimation; please select another time window with higher workload, or calibrate resource by hardware instead` is displayed.

- The capacity estimation based on actual workload needs to Prometheus metric data, including `resource_manager_resource_unit`, `process_cpu_usage`, `tikv_cpu_quota`, and `tidb_server_maxprocs`. If the corresponding metrics data is empty, an error is displayed indicating the name of the metrics item, for example `Error 1105 (HY000): metrics 'resource_manager_resource_unit' is empty`. And `resource_manager_resource_unit` is empty when no workload, so this error will also be reported. In addition, TiKV does not monitor CPU usage metrics on macOS, it does not support capacity estimation based on actual workload and the following error is displayed `ERROR 1105 (HY000): metrics 'process_cpu_usage' is empty`.

You can select an appropriate time range using **CPU Usage** in the [Metrics](#metrics) section.

## Metrics
Expand Down
13 changes: 13 additions & 0 deletions sql-statements/sql-statement-calibrate-resource.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@ If your application is already running in a production environment, or you can r
- The time window ranges from 10 minutes to 24 hours.
- In the specified time window, if the CPU utilization of TiDB and TiKV is too low, you cannot estimate the capacity.

> **Note:**
>
> TiKV does not monitor CPU usage metrics on macOS, it does not support capacity estimation based on actual workload on macOS.
### Estimate capacity based on hardware deployment

This method mainly estimates capacity based on the current cluster configuration, combined with the empirical values observed for different workloads. Because different types of workloads require different ratios of hardware, the output capacity of the same configuration of hardware might be different. The `WORKLOAD` parameter here accepts the following different workload types. The default value is `TPCC`.
Expand Down Expand Up @@ -102,6 +106,15 @@ CALIBRATE RESOURCE START_TIME '2023-04-18 08:00:00' DURATION '60m';
ERROR 1105 (HY000): The workload in selected time window is too low, with which TiDB is unable to reach a capacity estimation; please select another time window with higher workload, or calibrate resource by hardware instead
```

The capacity estimation needs to Prometheus metric data, including `resource_manager_resource_unit`, `process_cpu_usage`, `tikv_cpu_quota`, and `tidb_server_maxprocs`. If the corresponding metrics data is empty, an error is displayed indicating the name of the metrics item as shown in the following example. And `resource_manager_resource_unit` is empty when no workload, so this error will also be reported.

```sql
CALIBRATE RESOURCE START_TIME '2023-04-18 08:00:00' DURATION '60m';
Error 1105 (HY000): metrics 'resource_manager_resource_unit' is empty
```

TiKV does not monitor CPU usage metrics on macOS. An error indicating the name of the metrics item is shown in the following example.

Specify `WORKLOAD` to view the RU capacity. The default value is `TPCC`.

```sql
Expand Down

0 comments on commit bd9bda9

Please sign in to comment.