详解GaussDB(DWS) 资源监控「终于解决」

详解GaussDB(DWS) 资源监控「终于解决」摘要:本文主要着重介绍资源池资源监控以及用户资源监控。 本文分享自华为云社区《GaussDB(DWS)资源监控之用户、队列资源监控》,作者: 一只菜菜鸟。 GaussDB(DWS)资源监控功能包含实例

详解GaussDB(DWS) 资源监控

摘要:本文主要着重介绍资源池资源监控以及用户资源监控。

本文分享自华为云社区《GaussDB(DWS)资源监控之用户、队列资源监控》,作者: 一只菜菜鸟。

GaussDB(DWS)资源监控功能包含实例资源监控、内存资源监控、资源池资源监控、查询监控以及用户资源监控,本文主要着重介绍资源池资源监控以及用户资源监控;

多租户

用户是使用数据库系统以及执行业务的主要手段,在GaussDB(DWS)中将用户场景分为两种方案,分别是普通方案以及多租户方案;为了更好的使用GaussDB(DWS)的资源分组管理,建议依托多租户场景构造具体的使用情况;

多租户引入了两级用户机制,分别为组用户以及业务用户;两级用户分别关联不同的资源池以及存储空间;

详解GaussDB(DWS) 资源监控「终于解决」

示例

1、创建组用户关联到组资源池

CREATE USER user_g RESOURCE POOL "respool_g1" PASSWORD "Gauss_234";

2、创建业务用户关联到业务资源池

CREATE USER user_1 RESOURCE POOL "respool_g1" USER GROUP "user_g" PASSWORD "Gauss_234";

注:创建业务用户时,业务资源池(resource pool)和组用户(user group)为必选字段;

用户资源监控

用户资源监控中记录所有用户使用资源(内存、CPU核数、存储空间、临时空间、算子落盘以及IO)的实时使用情况,也可以通过查询历史表访问用户资源的历史使用情况;

相关GUC参数:

详解GaussDB(DWS) 资源监控「终于解决」

相关视图/表:

实时视图为:pg_total_user_resource_info;

    username     | used_memory | total_memory | used_cpu | total_cpu | used_space | total_space | used_temp_space | total_temp_space | used_spill_space | total_spill_space | read_kbytes | write_kbytes | read_counts | write_counts | read_speed | write_speed
-----------------+-------------+--------------+----------+-----------+------------+-------------+-----------------+------------------+------------------+-------------------+-------------+--------------+-------------+--------------+------------+-------------
 perfadm | 0 | 0 | 0 | 0 | 0 | -1 | 0 | -1 | 0 | -1 | 0 | 0 | 0 | 0 | 0 | 0
 user_g1_job_2   | 0 | 1113 | 0 | 24 | 0 | -1 | 0 | -1 | 0 | -1 | 0 | 0 | 0 | 0 | 0 | 0
 user_grp_2      | 0 | 5574 | 0 | 24 | 0 | -1 | 0 | -1 | 0 | -1 | 0 | 0 | 0 | 0 | 0 | 0
 user_g1_job_1_2 | 0 | 1113 | 0 | 24 | 0 | -1 | 0 | -1 | 0 | -1 | 0 | 0 | 0 | 0 | 0 | 0
 user_2          | 0 | 27876 | 0 | 24 | 0 | -1 | 0 | -1 | 0 | -1 | 0 | 0 | 0 | 0 | 0 | 0
 user_grp_1      | 0 | 5574 | 0 | 24 | 0 | -1 | 0 | -1 | 0 | -1 | 0 | 0 | 0 | 0 | 0 | 0
 user_1          | 0 | 27876 | 0 | 24 | 0 | -1 | 0 | -1 | 0 | -1 | 0 | 0 | 0 | 0 | 0 | 0
 user_4          | 0 | 27876 | 0 | 24 | 0 | -1 | 0 | -1 | 0 | -1 | 0 | 0 | 0 | 0 | 0 | 0
 user_g1_job_1_1 | 0 | 1113 | 0 | 24 | 0 | -1 | 0 | -1 | 0 | -1 | 0 | 0 | 0 | 0 | 0 | 0
 user_g2_job_1   | 0 | 1113 | 0 | 24 | 0 | -1 | 0 | -1 | 0 | -1 | 0 | 0 | 0 | 0 | 0 | 0
 user_5          | 0 | 27876 | 0 | 24 | 0 | -1 | 0 | -1 | 0 | -1 | 0 | 0 | 0 | 0 | 0 | 0
 user_3          | 0 | 27876 | 0 | 24 | 0 | -1 | 0 | -1 | 0 | -1 | 0 | 0 | 0 | 0 | 0 | 0
 user_g2_job_2   | 0 | 1113 | 0 | 24 | 0 | -1 | 0 | -1 | 0 | -1 | 0 | 0 | 0 | 0 | 0 | 0
(13 rows)

历史视图为:gs_wlm_user_resource_history;

    username      |           timestamp           | used_memory | total_memory | used_cpu | total_cpu | used_space | total_space | used_temp_space | total_temp_space | used_spill_space | total_spill_space | read_kbytes | write_kbytes | read_counts | write_counts | read_speed | write_speed
-------------------+-------------------------------+-------------+--------------+----------+-----------+------------+-------------+-----------------+------------------+------------------+-------------------+-------------+--------------+-------------+--------------+------------+-------------
 perfadm | 2022-06-29 14:26:32.063948+08 | 0 | 0 | 0 | 0 | 0 | -1 | 0 | -1 | 0 | -1 | 0 | 0 | 0 | 0 | 0 | 0
 user_3            | 2022-06-29 14:26:32.063948+08 | 0 | 27876 | 0 | 24 | 0 | -1 | 0 | -1 | 0 | -1 | 0 | 0 | 0 | 0 | 0 | 0
 user_5            | 2022-06-29 14:26:32.063948+08 | 0 | 27876 | 0 | 24 | 0 | -1 | 0 | -1 | 0 | -1 | 0 | 0 | 0 | 0 | 0 | 0
 user_g2_job_1     | 2022-06-29 14:26:32.063948+08 | 0 | 1113 | 0 | 24 | 0 | -1 | 0 | -1 | 0 | -1 | 0 | 0 | 0 | 0 | 0 | 0
 user_g1_job_1_1   | 2022-06-29 14:26:32.063948+08 | 0 | 1113 | 0 | 24 | 0 | -1 | 0 | -1 | 0 | -1 | 0 | 0 | 0 | 0 | 0 | 0
 user_4            | 2022-06-29 14:26:32.063948+08 | 0 | 27876 | 0 | 24 | 0 | -1 | 0 | -1 | 0 | -1 | 0 | 0 | 0 | 0 | 0 | 0
 user_1            | 2022-06-29 14:26:32.063948+08 | 0 | 27876 | 0 | 24 | 0 | -1 | 0 | -1 | 0 | -1 | 0 | 0 | 0 | 0 | 0 | 0
 user_grp_1        | 2022-06-29 14:26:32.063948+08 | 0 | 5574 | 0 | 24 | 0 | -1 | 0 | -1 | 0 | -1 | 0 | 0 | 0 | 0 | 0 | 0
 user_2            | 2022-06-29 14:26:32.063948+08 | 0 | 27876 | 0 | 24 | 0 | -1 | 0 | -1 | 0 | -1 | 0 | 0 | 0 | 0 | 0 | 0
 user_g1_job_1_2   | 2022-06-29 14:26:32.063948+08 | 0 | 1113 | 0 | 24 | 0 | -1 | 0 | -1 | 0 | -1 | 0 | 0 | 0 | 0 | 0 | 0
 user_grp_2        | 2022-06-29 14:26:32.063948+08 | 0 | 5574 | 0 | 24 | 0 | -1 | 0 | -1 | 0 | -1 | 0 | 0 | 0 | 0 | 0 | 0
 user_g2_job_2     | 2022-06-29 14:26:32.063948+08 | 0 | 1113 | 0 | 24 | 0 | -1 | 0 | -1 | 0 | -1 | 0 | 0 | 0 | 0 | 0 | 0
 user_g1_job_2     | 2022-06-29 14:26:32.063948+08 | 0 | 1113 | 0 | 24 | 0 | -1 | 0 | -1 | 0 | -1 | 0 | 0 | 0 | 0 | 0 | 0
 user_1            | 2022-06-29 14:26:01.987779+08 | 0 | 27876 | 0 | 24 | 0 | -1 | 0 | -1 | 0 | -1 | 0 | 0 | 0 | 0 | 0 | 0
 user_g2_job_2     | 2022-06-29 14:26:01.987779+08 | 0 | 1113 | 0 | 24 | 0 | -1 | 0 | -1 | 0 | -1 | 0 | 0 | 0 | 0 | 0 | 0

资源池资源监控

多租户场景下,用户关联资源池执行业务,其消耗的资源汇总到其对应的资源池上,可以通过资源池资源监控视图,实时查看其相应数值,以及历史表记录的资源历史使用情况;

相关GUC参数

同用户资源监控相关GUC参数。

相关视图/表

资源池实时信息监控视图:GS_RESPOOL_RUNTIME_INFO

 nodegroup | rpname | ref_count | fast_run | fast_wait | slow_run | slow_wait
-----------+------------------+-----------+----------+-----------+----------+-----------
 lc1       | respool_grp_1    | 0 | 0 | 0 | 0 | 0
 lc1       | default_pool | 0 | 0 | 0 | 0 | 0
 lc1       | respool_g1_job_1 | 0 | 0 | 0 | 0 | 0
 lc1       | respool_g1_job_2 | 0 | 0 | 0 | 0 | 0
 lc1       | respool_grp_2    | 0 | 0 | 0 | 0 | 0
 lc1       | respool_g2_job_1 | 0 | 0 | 0 | 0 | 0
 lc1       | respool_g2_job_2 | 0 | 0 | 0 | 0 | 0
 lc1       | respool_1        | 0 | 0 | 0 | 0 | 0
 lc1       | respool_2        | 0 | 0 | 0 | 0 | 0
 lc2       | default_pool | 0 | 0 | 0 | 0 | 0
 lc1       | respool_3        | 0 | 0 | 0 | 0 | 0
(11 rows)

资源池实时资源监控视图:GS_RESPOOL_RESOURCE_INFO

 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
-----------+------------------+---------------------+-----------+----------+-----------+------------+----------+-----------+------------+----------+-----------+----------+--------------+-----------+-------------+--------------+-------------+--------------+------------+-------------
 lc1       | respool_grp_1    | ClassG1             | 0 | 0 | 0 | -1 | 0 | 0 | 10 | 0 | 24 | 0 | 0 | 5574 | 0 | 0 | 0 | 0 | 0 | 0
 lc1       | default_pool | DefaultClass:Medium | 0 | 0 | 0 | -1 | 0 | 0 | -1 | 0 | 24 | 0 | 0 | 27876 | 0 | 0 | 0 | 0 | 0 | 0
 lc1       | respool_g1_job_1 | ClassG1:wg1_1       | 0 | 0 | 0 | -1 | 0 | 0 | 10 | 0 | 24 | 0 | 0 | 1113 | 0 | 0 | 0 | 0 | 0 | 0
 lc1       | respool_g1_job_2 | ClassG1:wg1_2       | 0 | 0 | 0 | -1 | 0 | 0 | 10 | 0 | 24 | 0 | 0 | 1113 | 0 | 0 | 0 | 0 | 0 | 0
 lc1       | respool_grp_2    | ClassG2             | 0 | 0 | 0 | -1 | 0 | 0 | 10 | 0 | 24 | 0 | 0 | 5574 | 0 | 0 | 0 | 0 | 0 | 0
 lc1       | respool_g2_job_1 | ClassG2:wg2_1       | 0 | 0 | 0 | -1 | 0 | 0 | 10 | 0 | 24 | 0 | 0 | 1113 | 0 | 0 | 0 | 0 | 0 | 0
 lc1       | respool_g2_job_2 | ClassG2:wg2_2       | 0 | 0 | 0 | -1 | 0 | 0 | 10 | 0 | 24 | 0 | 0 | 1113 | 0 | 0 | 0 | 0 | 0 | 0
 lc1       | respool_1        | ClassN1:wn1         | 0 | 0 | 0 | -1 | 0 | 0 | 10 | 0 | 24 | 0 | 0 | 27876 | 0 | 0 | 0 | 0 | 0 | 0
 lc1       | respool_2        | ClassN1:wn2         | 0 | 0 | 0 | -1 | 0 | 0 | 10 | 0 | 24 | 0 | 0 | 27876 | 0 | 0 | 0 | 0 | 0 | 0
 lc2       | default_pool | DefaultClass:Medium | 0 | 0 | 0 | -1 | 0 | 0 | -1 | 0 | 24 | 0 | 0 | 27876 | 0 | 0 | 0 | 0 | 0 | 0
 lc1       | respool_3        | ClassN2:wn3         | 0 | 0 | 0 | -1 | 0 | 0 | 10 | 0 | 24 | 0 | 0 | 27876 | 0 | 0 | 0 | 0 | 0 | 0
(11 rows)

资源池历史资源监控表:GS_RESPOOL_RESOURCE_HISTORY

           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-06-29 14:35:02.262234+08 | lc1       | respool_grp_1        | ClassG1             | 0 | 0 | 0 | -1 | 0 | 0 | 10 | 0 | 24 | 0 | 0 | 5574 | 0 | 0 | 0 | 0 | 0 | 0
 2022-06-29 14:35:02.262234+08 | lc1       | respool_3            | ClassN2:wn3         | 0 | 0 | 0 | -1 | 0 | 0 | 10 | 0 | 24 | 0 | 0 | 27876 | 0 | 0 | 0 | 0 | 0 | 0
 2022-06-29 14:35:02.262234+08 | lc2       | default_pool | DefaultClass:Medium | 0 | 0 | 0 | -1 | 0 | 0 | -1 | 0 | 24 | 0 | 0 | 27876 | 0 | 0 | 0 | 0 | 0 | 0
 2022-06-29 14:35:02.262234+08 | lc1       | respool_2            | ClassN1:wn2         | 0 | 0 | 0 | -1 | 0 | 0 | 10 | 0 | 24 | 0 | 0 | 27876 | 0 | 0 | 0 | 0 | 0 | 0
 2022-06-29 14:35:02.262234+08 | lc1       | respool_1            | ClassN1:wn1         | 0 | 0 | 0 | -1 | 0 | 0 | 10 | 0 | 24 | 0 | 0 | 27876 | 0 | 0 | 0 | 0 | 0 | 0
 2022-06-29 14:35:02.262234+08 | lc1       | respool_g2_job_2     | ClassG2:wg2_2       | 0 | 0 | 0 | -1 | 0 | 0 | 10 | 0 | 24 | 0 | 0 | 1113 | 0 | 0 | 0 | 0 | 0 | 0
 2022-06-29 14:35:02.262234+08 | lc1       | respool_g2_job_1     | ClassG2:wg2_1       | 0 | 0 | 0 | -1 | 0 | 0 | 10 | 0 | 24 | 0 | 0 | 1113 | 0 | 0 | 0 | 0 | 0 | 0
 2022-06-29 14:35:02.262234+08 | lc1       | respool_grp_2        | ClassG2             | 0 | 0 | 0 | -1 | 0 | 0 | 10 | 0 | 24 | 0 | 0 | 5574 | 0 | 0 | 0 | 0 | 0 | 0
 2022-06-29 14:35:02.262234+08 | lc1       | respool_g1_job_2     | ClassG1:wg1_2       | 0 | 0 | 0 | -1 | 0 | 0 | 10 | 0 | 24 | 0 | 0 | 1113 | 0 | 0 | 0 | 0 | 0 | 0
 2022-06-29 14:35:02.262234+08 | lc1       | respool_g1_job_1     | ClassG1:wg1_1       | 0 | 0 | 0 | -1 | 0 | 0 | 10 | 0 | 24 | 0 | 0 | 1113 | 0 | 0 | 0 | 0 | 0 | 0
 2022-06-29 14:35:02.262234+08 | lc1       | default_pool | DefaultClass:Medium | 0 | 0 | 0 | -1 | 0 | 0 | -1 | 0 | 24 | 0 | 0 | 27876 | 0 | 0 | 0 | 0 | 0 | 0
 2022-06-29 14:34:31.517585+08 | lc1       | respool_g2_job_1     | ClassG2:wg2_1       | 0 | 

 

点击关注,第一时间了解华为云新鲜技术~

原文地址:https://www.cnblogs.com/huaweiyun/archive/2022/08/26/16626801.html

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 举报,一经查实,本站将立刻删除。
转载请注明出处: https://daima100.com/4856.html

(0)
上一篇 2023-06-02 10:30
下一篇 2023-06-02

相关推荐

  • python中将列表赋值(python列表赋初值)

    python中将列表赋值(python列表赋初值) 列表(list)是Python中一个非常重要的类型,用于管理一组数据,列表的形式如下所示

    2023-10-29
    136
  • exp imp_imp啥意思

    exp imp_imp啥意思一.说明 oracle 的exp/imp命令用于实现对数据库的导出/导入操作; exp命令用于把数据从远程数据库server导出至本地,生成dmp文件; imp命令用于把本地的数据库dmp文件从本地导

    2023-03-17
    133
  • 以Python逆序输出为中心

    以Python逆序输出为中心Python作为一门强大的编程语言,一直以来都备受程序员们的青睐。其中,逆序输出是python中常见的操作之一。本文将从多个方面对“以Python逆序输出为中心”进行讲解,帮助读者更好地理解这一操作。

    2024-07-20
    38
  • mysql转换大写_数字转大写金额的函数

    mysql转换大写_数字转大写金额的函数MySQL版本:5.7.34-log *通过创建函数的方法,目前可以实现整数金额的转换,网上暂未找到MySQL版本的故自己参照其他数据库版本的改编了一下,*仅供参考!!! 使用方法:select rm

    2023-05-11
    155
  • mongo shell「建议收藏」

    mongo shell「建议收藏」mongo shell mongo 连接 本地 远程 带认证的方式 复制集 SSL方式 mongo shell 操作 当插入数据时会自动创建集合 在mongo第一次显示提示之前,会自动运行 目录下的

    2022-12-29
    156
  • 1.AutoMapper简单介绍[通俗易懂]

    1.AutoMapper简单介绍[通俗易懂]官网:http://automapper.org/ 源码:https://github.com/AutoMapper/AutoMapper NUGET安装: PM> Install-Packag

    2022-12-29
    150
  • JDBC基本使用方法[亲测有效]

    JDBC基本使用方法[亲测有效] JDBC基本使用方法 JDBC固定步骤: 加载驱动 连接数据库,代表数据库 向数据库发送SQL的对象Statement: CRUD 编写SQL (根据业务, 不同的SQL) 执行SQL 遍历结果集

    2023-03-01
    154
  • Oracle 数据泵expdq,impdq[通俗易懂]

    Oracle 数据泵expdq,impdq[通俗易懂]使用数据泵技术实现逻辑备份 数据泵概述 数据泵(DATA PUMP)是一种在数据库之间、数据库与操作系统之间,高速传输数据的技术(10g推出)。 逻辑备份概述 逻辑备份是对数据库对象(如用户、表、存储

    2022-12-30
    143

发表回复

您的电子邮箱地址不会被公开。 必填项已用*标注