数据仓库服务 GAUSSDB(DWS)-PGXC_OBS_IO_SCHEDULER_STATS:示例

时间:2024-06-19 14:33:02

示例

  1. 查询OBS IO Scheduler在每个节点读请求相关的统计信息。

    1
    2
    3
    4
    5
    6
    SELECT * FROM pgxc_obs_io_scheduler_stats WHERE io_type = 'r' ORDER BY node_name;
      node_name   | io_type | current_bps | best_bps | waiting_request_num | mean_request_size | total_token_num | available_token_num | total_worker_num | idle_worker_num
    --------------+---------+-------------+----------+---------------------+-------------------+-----------------+---------------------+------------------+-----------------
     dn_6001_6002 | r       |       26990 |    26990 |                   0 |               215 |              18 |                  16 |               12 |              10
     dn_6003_6004 | r       |       21475 |    21475 |                  10 |               190 |              30 |                  30 |               20 |              20
     dn_6005_6006 | r       |       12384 |    12384 |                  36 |               133 |              30 |                  27 |               20 |              17
    

    查询结果显示,这是当前IO Scheduler在进行读取IO操作时的某个时刻统计信息的快照(snapshot),此时带宽处于上升阶段,current_bps与best_bps相等。以dn_6003_6004为例,可以观察到该DN当前队列中存在排队的请求,total_token_num与available_token_num相等,说明查询视图的时刻IO Scheduler还未开始处理这些请求。

  2. 等待一段时间后,再次发起查询。

    SELECT * FROM pgxc_obs_io_scheduler_stats WHERE io_type = 'r' ORDER BY node_name;
      node_name   | io_type | current_bps | best_bps | waiting_request_num | mean_request_size | total_token_num | available_token_num | total_worker_num | idle_worker_num
    --------------+---------+-------------+----------+---------------------+-------------------+-----------------+---------------------+------------------+-----------------
     dn_6001_6002 | r       |       13228 |    26990 |                   0 |               609 |              18 |                  18 |               12 |              12
     dn_6003_6004 | r       |       15717 |    21475 |                   0 |               622 |              30 |                  30 |               20 |              20
     dn_6005_6006 | r       |       18041 |    21767 |                   0 |               609 |              30 |                  30 |               20 |              20

    此时队列中已经没有了排队的请求,且available_token_num等于total_token_num,说明IO Scheduler已经处理完所有请求,且没有新的请求需要被处理;但观察到current_bps不为零,是因为统计bps的周期为3秒,此时显示的是3秒前的结果。

  1. 短暂间隔后再次查询结果如下,current_bps更新为0。

    SELECT * FROM pgxc_obs_io_scheduler_stats WHERE io_type = 'r' ORDER BY node_name;
      node_name   | io_type | current_bps | best_bps | waiting_request_num | mean_request_size | total_token_num | available_token_num | total_worker_num | idle_worker_num
    --------------+---------+-------------+----------+---------------------+-------------------+-----------------+---------------------+------------------+-----------------
     dn_6001_6002 | r       |           0 |    26990 |                   0 |               609 |              18 |                  18 |               12 |              12
     dn_6003_6004 | r       |           0 |    21475 |                   0 |               622 |              30 |                  30 |               20 |              20
     dn_6005_6006 | r       |           0 |    21767 |                   0 |               609 |              30 |                  30 |               20 |              20

support.huaweicloud.com/devg-dws-v3/dws_16_0027.html