All Products
Search
Document Center

:Resource Manager

Last Updated:Jun 20, 2026

Resource Manager is a feature in PolarDB that allows you to monitor cluster CPU utilization and memory usage in real time. It supports two monitoring dimensions: user threads and resource groups. This allows you to understand the operational status of your system, identify sources of pressure, and distribute the load accordingly. This topic describes how to use Resource Manager.

Prerequisites

Your PolarDB cluster must run PolarDB for MySQL 8.0, and its revision version must be 8.0.2.1.0 or later.

Note For information about how to upgrade the revision version, see revision version management.

Usage notes

  • Enabling the thread pool feature results in inaccurate statistics for CPU utilization and memory usage. Therefore, you cannot enable the resource_group_enabled and loose_thread_pool_enabled parameters at the same time.
  • Custom resource group configurations are not supported. All user threads are assigned to the user_default resource group after a successful connection. System background threads are assigned to the sys_default resource group.

Parameter configuration

You can configure the following parameters for Resource Manager:

Note
  • To enable the Resource Manager monitoring feature, you must set the resource_group_enabled, performance_schema, and cpu_usage_capture_enabled parameters to ON.
  • After you set the resource_group_enabled, performance_schema, and cpu_usage_capture_enabled parameters, you must restart all nodes in the cluster for the new settings to take effect. Plan your operations accordingly and restart with caution.
Parameter Value Description
resource_group_enabled

ON or OFF

Default value: OFF

Specifies whether to enable the resource group feature.
performance_schema

ON or OFF

Default value: OFF

Specifies whether to enable the Performance Schema feature.
cpu_usage_capture_enabled

ON or OFF

Default value: OFF

Specifies whether to enable CPU utilization collection.
cpu_usage_capture_interval

100 to 1000

Default value: 500

The CPU utilization collection interval, in milliseconds.

This parameter specifies the minimum interval between consecutive sampling operations.

cpu_usage_summarize_interval

1000 to ULONG_MAX

Default value: 2000

The CPU utilization summary interval, in milliseconds.

This parameter specifies the time window for calculating the average CPU utilization displayed in query results.

performance_schema_minimal

ON or OFF

Default value: OFF

Specifies whether to minimize the memory usage of Performance Schema.

Setting the performance_schema parameter to ON enables many performance-related statistics by default, which has a significant impact on performance. To reduce the performance impact of the performance_schema parameter, we recommend that you set the performance_schema_minimal parameter to ON.

Note You can configure this parameter only when performance_schema is set to ON.

Resource monitoring

  • You can run the following commands to query the resource usage of threads:
    call db_resource_manager.show_processlist();
    call db_resource_manager.show_processlist_verbose();
    Note
    • The show_processlist command aggregates the resources of parallel subthreads into the main thread, so the results do not display subthreads separately. As a result, the reported CPU utilization may exceed 100%.
    • The show_processlist_verbose command displays subthreads separately.
    mysql> call db_resource_manager.show_processlist();
    +------+------+-----------------+------+---------+------+-----------+-----------+----------------+-----------+---------+-----+----------------------------------------------+
    | ID   | USER | HOST            | DB   | COMMAND | TIME | STATE     | PARENT_ID | RESOURCE_GROUP | CPU_RATIO | MEM     | DOP | INFO                                         |
    +------+------+-----------------+------+---------+------+-----------+-----------+----------------+-----------+---------+-----+----------------------------------------------+
    |    7 | root | 127.0.0.1:47983 | test | Query   |    0 | starting  |      NULL | USR_default    | 0.00      |  455273 |   1 | call db_resource_manager.show_processlist()   |
    |   12 | root | 127.0.0.1:53189 | tpch | Query   |   51 | executing |      NULL | USR_default    | 380.86    | 1238314 |   4 | select                                       |
    |      |      |                 |      |         |      |           |           |                |           |         |     | l_returnflag,                                |
    |      |      |                 |      |         |      |           |           |                |           |         |     | l_linestatus,                                |
    |      |      |                 |      |         |      |           |           |                |           |         |     | sum(l_quantity) as sum_qty,                  |
    |      |      |                 |      |         |      |           |           |                |           |         |     | sum(l                                        |
    +------+------+-----------------+------+---------+------+-----------+-----------+----------------+-----------+---------+-----+----------------------------------------------+
    2 rows in set (0.00 sec)
    
    mysql> call db_resource_manager.show_processlist_verbose();
    +------+------+-----------------+------+---------+------+-----------+-----------+----------------+-----------+--------+-----+----------------------------------------------+
    | ID   | USER | HOST            | DB   | COMMAND | TIME | STATE     | PARENT_ID | RESOURCE_GROUP | CPU_RATIO | MEM    | DOP | INFO                                         |
    +------+------+-----------------+------+---------+------+-----------+-----------+----------------+-----------+--------+-----+----------------------------------------------+
    |    7 | root | 127.0.0.1:47983 | test | Query   |    0 | starting  |      NULL | USR_default    | 0.02      | 455273 |   1 | call db_resource_manager.show_processlist_verbose() |
    |   12 | root | 127.0.0.1:53189 | tpch | Query   |   53 | executing |      NULL | USR_default    | 0.00      | 521446 |   4 | select                                       |
    |      |      |                 |      |         |      |           |           |                |           |        |     | l_returnflag,                                |
    |      |      |                 |      |         |      |           |           |                |           |        |     | l_linestatus,                                |
    |      |      |                 |      |         |      |           |           |                |           |        |     | sum(l_quantity) as sum_qty,                  |
    |      |      |                 |      |         |      |           |           |                |           |        |     | sum(l                                        |
    |   13 | root | 127.0.0.1:53189 | tpch | Query   |   53 | executing |        12 | USR_default    | 96.71     | 192442 |   1 | NULL                                         |
    |   14 | root | 127.0.0.1:53189 | tpch | Query   |   53 | executing |        12 | USR_default    | 93.13     | 185954 |   1 | NULL                                         |
    |   15 | root | 127.0.0.1:53189 | tpch | Query   |   53 | executing |        12 | USR_default    | 94.73     | 183398 |   1 | NULL                                         |
    |   16 | root | 127.0.0.1:53189 | tpch | Query   |   53 | executing |        12 | USR_default    | 96.73     | 196194 |   1 | NULL                                         |
    +------+------+-----------------+------+---------+------+-----------+-----------+----------------+-----------+--------+-----+----------------------------------------------+
    6 rows in set (0.00 sec)
    You can also run the following commands to filter and sort the query results:
    select * from information_schema.processlist_verbose order by cpu_ratio desc limit 10;
    select * from information_schema.processlist_verbose where time > 60 order by mem desc
  • You can run the following command to query all resource groups in the system and their configurations:
    select * from information_schema.resource_group;
    Note Before you run this query, you must set the resource_group_enabled parameter to ON. For more information, see Parameter configuration.

Performance impact

Enabling the Resource Manager feature has a minor impact on the performance of a PolarDB cluster. However, because enabling performance_schema activates numerous statistics collectors by default, it can have a more significant performance impact.

测试结果 测试结果

The preceding Sysbench performance tests show the following:

  • Enabling Resource Manager (by setting performance_schema and resource_group_enabled to ) with performance_schema_minimal set to decreases performance by approximately 8% compared to when the feature is disabled (the default setting where performance_schema and resource_group_enabled are ).
  • Enabling Resource Manager (by setting performance_schema and resource_group_enabled to ) with performance_schema_minimal set to causes a smaller performance decrease of approximately 2% compared to when the feature is disabled (the default setting where performance_schema and resource_group_enabled are ).
Note
  • To reduce the performance impact of the performance_schema parameter, we recommend setting the performance_schema_minimal parameter to ON.
  • The preceding tests were performed using Sysbench on a PolarDB for MySQL cluster with 8 cores and 32 GB of memory. The performance impact may vary depending on the instance configuration and use case.