|
| 1 | +--- |
| 2 | +title: Calibrate Resource |
| 3 | +summary: Learn how to estimate the RU capacity of your TiDB Cloud Dedicated cluster and allocate resources to resource groups. |
| 4 | +--- |
| 5 | + |
| 6 | +# Calibrate Resource |
| 7 | + |
| 8 | +[Request Unit (RU)](/tidb-resource-control-ru-groups.md#what-is-request-unit-ru) is a resource abstraction unit that represents system resource consumption. Before you allocate resources to [resource groups](/tidb-resource-control-ru-groups.md), it is recommended to estimate the total RU capacity of your cluster first. |
| 9 | + |
| 10 | +For TiDB Cloud Dedicated clusters, you can estimate the RU capacity by using the **Calibrate Resource** feature on the **Monitoring** page of the TiDB Cloud console. This feature is available for all TiDB Cloud Dedicated clusters. |
| 11 | + |
| 12 | +> **Note:** |
| 13 | +> |
| 14 | +> The estimated capacity is calculated based on hardware specifications or past statistics, and might deviate from the actual capacity of your cluster. |
| 15 | +
|
| 16 | +## Estimate the cluster capacity |
| 17 | + |
| 18 | +1. On the [**My TiDB**](https://tidbcloud.com/tidbs) page, click the name of your target cluster to go to its overview page. |
| 19 | + |
| 20 | + > **Tip:** |
| 21 | + > |
| 22 | + > If you are in multiple organizations, use the combo box in the upper-left corner to switch to your target organization first. |
| 23 | +
|
| 24 | +2. In the left navigation pane, click **Monitoring**, and then click **Calibrate Resource**. |
| 25 | + |
| 26 | +3. Choose one of the following calibration methods: |
| 27 | + |
| 28 | + - **Calibrate by Hardware**: estimates the capacity based on the current cluster configuration and the workload model you select. The following workload types are supported, and the default workload type is `TPCC`. |
| 29 | + |
| 30 | + - `TPCC`: applies to workloads with heavy data write. It is estimated based on a workload model similar to `TPC-C`. |
| 31 | + - `OLTP_WRITE_ONLY`: applies to workloads with heavy data write. It is estimated based on a workload model similar to `sysbench oltp_write_only`. |
| 32 | + - `OLTP_READ_WRITE`: applies to workloads with even data read and write. It is estimated based on a workload model similar to `sysbench oltp_read_write`. |
| 33 | + - `OLTP_READ_ONLY`: applies to workloads with heavy data read. It is estimated based on a workload model similar to `sysbench oltp_read_only`. |
| 34 | + |
| 35 | + - **Calibrate by Workload**: estimates the capacity based on the actual workload in a selected time window. The time window ranges from 10 minutes to 24 hours. |
| 36 | + |
| 37 | + If the workload in the selected time window is too low, TiDB cannot generate a capacity estimate. In this case, select another time window with a higher workload, or calibrate resources based on your hardware instead. |
| 38 | + |
| 39 | +4. View the estimation results in the following cards: |
| 40 | + |
| 41 | + - **Estimated Capacity**: the estimated total RU capacity of the cluster. |
| 42 | + - **Total RU of user resource groups**: the total amount of RU allocated to all user resource groups, excluding the `default` resource group. If this value is more than the estimated capacity, the system triggers an alert. |
| 43 | + |
| 44 | +The page also shows the following metric charts to help you understand the current resource consumption of the cluster: |
| 45 | + |
| 46 | +- **Total RU Consumed**: the total consumption of Request Units counted in real time. |
| 47 | +- **RU Consumed by Resource Groups**: the number of Request Units consumed by resource groups in real time. |
| 48 | + |
| 49 | +## Change the resource allocation |
| 50 | + |
| 51 | +To change the resource allocation for a resource group, use the following statement: |
| 52 | + |
| 53 | +```sql |
| 54 | +ALTER RESOURCE GROUP <resource group name> RU_PER_SEC=<#ru> [BURSTABLE]; |
| 55 | +``` |
| 56 | + |
| 57 | +For more information about resource groups, see [Use Resource Control to Achieve Resource Group Limitation and Flow Control](/tidb-resource-control-ru-groups.md). |
| 58 | + |
| 59 | +## Limitations |
| 60 | + |
| 61 | +- The `CALIBRATE RESOURCE` statement is not supported on TiDB Cloud Dedicated. To estimate the RU capacity of your cluster, use the **Calibrate Resource** feature in the TiDB Cloud console. |
| 62 | +- The **Calibrate Resource** feature is available only for TiDB Cloud Dedicated clusters, not for TiDB Cloud Starter, TiDB Cloud Essential, or TiDB Cloud Premium instances. |
0 commit comments