In the multi-tenant management framework, if queries are associated with resource pools, the resources occupied by the queries are summarized to the associated resource pools. You can query the real-time resource usage of all resource pools in the resource pool monitoring view and query the historical resource usage of resource pools in the resource pool monitoring history table.
The resource pool monitoring data is updated every 5s. However, due to the time difference between CNs and DNs, the actual monitoring data update time may be longer than 5s. Generally, the time does not exceed 10s. The resource pool monitoring data is persisted every 30 seconds. The resource pool monitoring logic is basically the same as that of the user resource monitoring. Therefore, the enable_user_metric_persistent and user_metric_retention_time parameters are used to control the persistence and aging of resource pool monitoring data, respectively.
Resources monitored by a resource pool include the running and queuing information of fast and slow lane jobs, and CPU, memory, and logical I/O resource monitoring information. The monitoring views and history tables are as follows:
1 | SELECT * FROM GS_RESPOOL_RUNTIME_INFO; |
The result view is as follows:
1 2 3 4 5 6 7 8 9 | nodegroup | rpname | ref_count | fast_run | fast_wait | slow_run | slow_wait -----------+--------------+-----------+----------+-----------+----------+----------- vc1 | p2 | 10 | 0 | 0 | 0 | 0 vc2 | p3 | 10 | 5 | 5 | 0 | 0 vc2 | p4 | 0 | 0 | 0 | 0 | 0 vc1 | default_pool | 0 | 0 | 0 | 0 | 0 vc2 | default_pool | 0 | 0 | 0 | 0 | 0 vc1 | p1 | 20 | 5 | 5 | 3 | 7 (6 rows) |
Where,
1 | SELECT * FROM GS_RESPOOL_RESOURCE_INFO; |
The result view is as follows:
1 2 3 4 5 6 7 8 9 | nodegroup | rpname | cgroup | ref_count | fast_run | fast_wait | fast_limit | slow_run | slow_wait | slow_limit | used_cpu | cpu_limit | used_mem | estimate_mem | mem_limit |read_kbytes | write_kbytes | read_counts | write_counts | read_speed | write_speed -----------+--------------+---------------------+-----------+----------+-----------+------------+----------+-----------+------------+----------+-----------+----------+--------------+-----------+-------------+--------------+-------------+--------------+------------+------------- vc1 | p2 | DefaultClass:Rush | 10 | 0 | 0 | -1 | 0 | 0 | 10 | 9.97 | 48 | 20 | 0 | 11555 | 8 | 2880 | 1 | 360 | 1 | 589 vc2 | p3 | DefaultClass:Rush | 10 | 5 | 5 | 5 | 0 | 0 | 10 | 4.98 | 48 | 11 | 0 | 11555 | 0 | 848 | 0 | 106 | 0 | 173 vc2 | p4 | DefaultClass:Rush | 0 | 0 | 0 | -1 | 0 | 0 | 10 | 0 | 48 | 0 | 0 | 11555 | 0 | 0 | 0 | 0 | 0 | 0 vc1 | default_pool | DefaultClass:Medium | 0 | 0 | 0 | -1 | 0 | 0 | -1 | 0 | 48 | 0 | 0 | 11555 | 0 | 0 | 0 | 0 | 0 | 0 vc2 | default_pool | DefaultClass:Medium | 0 | 0 | 0 | -1 | 0 | 0 | -1 | 0 | 48 | 0 | 0 | 11555 | 0 | 0 | 0 | 0 | 0 | 0 vc1 | p1 | DefaultClass:Rush | 20 | 5 | 5 | 5 | 3 | 7 | 3 | 7.98 | 48 | 16 | 768 | 11555 | 8 | 2656 | 1 | 332 | 1 | 543 (6 rows) |
1 | SELECT * FROM GS_RESPOOL_RESOURCE_HISTORY ORDER BY timestamp DESC; |
The result view is as follows:
1 2 3 4 5 6 7 8 9 | timestamp | nodegroup | rpname | cgroup | ref_count | fast_run | fast_wait | fast_limit | slow_run | slow_wait | slow_limit | used_cpu | cpu_limit | used_mem | estimate_mem | mem_limit | read_kbytes | write_kbytes | read_counts | write_counts | read_speed | write_speed -------------------------------+--------------+--------------+---------------------+-----------+----------+-----------+------------+----------+-----------+------------+----------+-----------+----------+--------------+-----------+-------------+--------------+-------------+--------------+------------+------------- 2022-03-04 09:41:57.53739+08 | vc1 | p2 | DefaultClass:Rush | 10 | 0 | 0 | -1 | 0 | 0 | 10 | 9.97 | 48 | 20 | 0 | 11555 | 0 | 2320 | 0 | 290 | 0 | 474 2022-03-04 09:41:57.53739+08 | vc1 | p1 | DefaultClass:Rush | 20 | 5 | 5 | 5 | 3 | 7 | 3 | 7.98 | 48 | 16 | 768 | 11555 | 0 | 1896 | 0 | 237 | 0 | 387 2022-03-04 09:41:57.53739+08 | vc2 | default_pool | DefaultClass:Medium | 0 | 0 | 0 | -1 | 0 | 0 | -1 | 0 | 48 | 0 | 0 | 11555 | 0 | 0 | 0 | 0 | 0 | 0 2022-03-04 09:41:57.53739+08 | vc1 | default_pool | DefaultClass:Medium | 0 | 0 | 0 | -1 | 0 | 0 | -1 | 0 | 48 | 0 | 0 | 11555 | 0 | 0 | 0 | 0 | 0 | 0 2022-03-04 09:41:57.53739+08 | vc2 | p4 | DefaultClass:Rush | 0 | 0 | 0 | -1 | 0 | 0 | 10 | 0 | 48 | 0 | 0 | 11555 | 0 | 0 | 0 | 0 | 0 | 0 2022-03-04 09:41:57.53739+08 | vc2 | p3 | DefaultClass:Rush | 10 | 5 | 5 | 5 | 0 | 0 | 10 | 4.99 | 48 | 11 | 0 | 11555 | 0 | 880 | 0 | 110 | 0 | 180 2022-03-04 09:41:27.335234+08 | vc2 | p3 | DefaultClass:Rush | 10 | 5 | 5 | 5 | 0 | 0 | 10 | 4.98 | 48 | 11 | 0 | 11555 | 0 | 856 | 0 | 107 | 0 | 175 |