title | summary |
---|---|
TiDB Dashboard Resource Manager Page |
TiDB Dashboard Resource Manager Page helps cluster administrators implement resource isolation by creating resource groups and setting quotas. It provides methods to estimate cluster capacity and monitor resource consumption. Access the page through TiDB Dashboard or a browser. The page includes sections for configuration, capacity estimation, and metrics. Capacity estimation methods include hardware deployment and actual workload. Monitoring metrics include total RU consumed, RU consumed by resource groups, TiDB CPU quota and usage, TiKV CPU quota and usage, and TiKV IO MBps. |
To implement resource isolation using the Resource Control feature, cluster administrators can create resource groups and set quotas for each group. Before resource planning, you need to know the overall capacity of the cluster. This document helps you view the information about resource control, so you can estimate the cluster capacity before resource planning and allocate resources more effectively.
You can use one of the following two methods to access the Resource Manager page:
-
After logging in to TiDB Dashboard, click Resource Manager in the left navigation menu.
-
Visit http://127.0.0.1:2379/dashboard/#/resource_manager in your browser. Replace
127.0.0.1:2379
with the actual PD instance address and port.
The following figure shows the Resource Manager details page:
The Resource Manager page contains the following three sections:
-
Configuration: This section displays the data obtained from the
RESOURCE_GROUPS
table of TiDB. It contains the information about all resource groups. For more information, seeRESOURCE_GROUPS
. -
Estimate Capacity: Before resource planning, you need to know the overall capacity of the cluster. You can use one of the following methods:
-
Metrics: By observing the metrics on the panels, you can understand the current overall resource consumption status of the cluster.
Before resource planning, you need to know the overall capacity of the cluster. TiDB provides two methods to estimate the capacity of Request Unit (RU) in the current cluster:
-
Estimate capacity based on hardware deployment
TiDB accepts the following workload types:
tpcc
: applies to workloads with heavy data write. It is estimated based on a workload model similar toTPC-C
.oltp_write_only
: applies to workloads with heavy data write. It is estimated based on a workload model similar tosysbench oltp_write_only
.oltp_read_write
: applies to workloads with even data read and write. It is estimated based on a workload model similar tosysbench oltp_read_write
.oltp_read_only
: applies to workloads with heavy data read. It is estimated based on a workload model similar tosysbench oltp_read_only
.
The Total RU of user resource groups represents the total amount of RU for all user resource groups, excluding the
default
resource group. If this value is less than the estimated capacity, the system triggers an alert. By default, the system allocates unlimited usage to the predefineddefault
resource group. When all users belong to thedefault
resource group, resources are allocated in the same way as when resource control is disabled. -
Estimate capacity based on actual workload
You can select a time range for estimation within the range of 10 minutes to 24 hours. The time zone used is the same as that of the front-end user.
-
When the time window range does not fall between 10 minutes and 24 hours, the following error is displayed
ERROR 1105 (HY000): the duration of calibration is too short, which could lead to inaccurate output. Please make the duration between 10m0s and 24h0m0s
. -
The monitoring metrics for the capacity estimation based on the actual workload feature include
tikv_cpu_quota
,tidb_server_maxprocs
,resource_manager_resource_unit
, andprocess_cpu_usage
. If the CPU quota monitoring data is empty, there will be an error with the corresponding monitoring metric name, for example,Error 1105 (HY000): There is no CPU quota metrics, metrics 'tikv_cpu_quota' is empty
. -
If the workload in the time window is too low, or the
resource_manager_resource_unit
andprocess_cpu_usage
monitoring data is missing, an error will be reportedError 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
. In addition, because TiKV does not monitor CPU utilization on macOS, it does not support capacity estimation based on the actual workload, and will also report this error.
You can select an appropriate time range using CPU Usage in the Metrics section.
-
Note:
To use the capacity estimation feature, the current login user must have the
SUPER
orRESOURCE_GROUP_ADMIN
privilege and theSELECT
privilege for some system tables. Before using this feature, ensure the current user has these privileges. Otherwise, some features might not work properly. For more information, seeCALIBRATE RESOURCE
.
By observing the metrics on the panels, you can understand the current overall resource consumption status of the cluster. The monitoring metrics and their meanings are as follows:
- Total RU Consumed: The total consumption of Request Units counted in real time.
- RU Consumed by Resource Groups: The number of Request Units consumed by resource groups in real time.
- TiDB
- CPU Quota: The maximum CPU usage of TiDB.
- CPU Usage: The total CPU usage of all TiDB instances.
- TiKV
- CPU Quota: The maximum CPU usage of TiKV.
- CPU Usage: The total CPU usage of all TiKV instances.
- IO MBps: The total I/O throughput of all TiKV instances.