数据仓库服务 GAUSSDB(DWS)-资源池资源监控:操作步骤

时间:2024-10-28 14:23:04

操作步骤

  • 查询资源池的作业实时运行情况。
    1
    SELECT * FROM GS_RESPOOL_RUNTIME_INFO;
    

    得到的结果视图如下:

    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)
    

    其中:

    1. ref_count为引用当前资源池信息的作业数,语句从进入管控到结束一直占用该计数;
    2. fast_run和slow_run为负载管理记账信息,只有管控(fast_limit/slow_limit大于0)时该值才有效;
    3. 该视图仅在CN上有效,持久化信息保存在GS_RESPOOL_RESOURCE_HISTORY中;
    4. 各字段说明详见GS_RESPOOL_RUNTIME_INFO
  • 查询资源池的资源限额和资源实时使用情况。
    1
    SELECT * FROM GS_RESPOOL_RESOURCE_INFO;
    

    得到的结果视图如下:

    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. 该视图在CN和DN上均有效,DN上CPU、内存和IO为本DN资源消耗情况,CN上CPU、内存和IO为集群内所有DN上资源消耗的累加和;
    2. estimate_mem仅在动态负载管理情况下CN上有效,显示资源池估算内存记账情况;
    3. IO监控信息仅在enable_logical_io_statistics开启时才会记录;
    4. 各字段说明详见GS_RESPOOL_RESOURCE_INFO
  • 查询资源池的资源限额和资源历史使用情况。
    1
    SELECT * FROM GS_RESPOOL_RESOURCE_HISTORY ORDER BY timestamp DESC;
    

    得到的结果视图如下:

    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
    
    1. 该监控信息来自资源池监控历史表,enable_user_metric_persistent开启时每30秒记录一次;
    2. 该表数据保存时间由GUC参数user_metric_retention_time控制;
    3. 各字段说明详见GS_RESPOOL_RESOURCE_HISTORY
support.huaweicloud.com/devg-dws/dws_04_0974.html