詳解GaussDB(DWS)中3個防過載檢查項

来源:https://www.cnblogs.com/huaweiyun/p/18080287
-Advertisement-
Play Games

本文分享自華為雲社區《【防過載檢查項】》,作者: 譡里個檔。 1. GUC參數檢查 目的:針對不同版本建議設定不同的參數值,當前先檢查出來,後續diagnosis會給出建議值 SELECT split_part((substring(version() from '\((.*)\)')), ' ', ...


本文分享自華為雲社區《【防過載檢查項】》,作者: 譡里個檔。

1. GUC參數檢查

目的:針對不同版本建議設定不同的參數值,當前先檢查出來,後續diagnosis會給出建議值

SELECT
    split_part((substring(version() from '\((.*)\)')), ' ', 2) AS version,
    (EXISTS (SELECT 1 FROM (SELECT count(DISTINCT node_name) AS dn_cnt 
      FROM pgxc_node WHERE node_type = 'D' AND node_host <> 'localhost' GROUP BY node_host) WHERE dn_cnt <> 1)
    ) AS sdn_per_node,
    node_name, name AS guc_name,
    CASE WHEN unit = 'ms' THEN setting::bigint/1000 || ' s'
         WHEN unit = 's' THEN setting || ' s'
         WHEN unit = 'KB' THEN pg_size_pretty(setting*1024)
         WHEN unit = '8KB' THEN pg_size_pretty(setting*1024*8)
         ELSE setting
    END AS setting, unit,
    CASE WHEN name = 'default_distribution_mode' THEN
             CASE WHEN setting <> 'roundrobin' THEN 'roundrobin' END
         WHEN name = 'autovacuum' THEN
             CASE WHEN setting <> 'on' THEN 'on' END
         WHEN name = 'autovacuum_max_workers' THEN
             CASE WHEN setting::int > 6 THEN '6' END
         WHEN name = 'autovacuum_max_workers' THEN
             CASE WHEN setting::int > 3 THEN '3' END
         WHEN name = 'session_timeout' THEN
             CASE WHEN setting::int > 600 OR setting::int = 0 THEN '<= 10min' END
         WHEN name = 'statement_timeout' THEN
             CASE WHEN setting::int > 24* 60 * 1000 OR setting::int = 0 THEN '<= 24h' END
         WHEN name = 'sql_use_spacelimit' THEN
             CASE WHEN setting::int > 300*1024*1024 OR setting IN ('0', '-1') THEN '<= 300GB' END
         WHEN name = 'temp_file_limit' THEN
             CASE WHEN setting::int > 100*1024*1024 OR setting IN ('0', '-1') THEN '<= 100GB' END
         WHEN name = 'udf_memory_limit' THEN
             CASE WHEN setting::int > 1*1024*1024  THEN '<= 1GB' END
         WHEN name = 'query_dop' THEN
             CASE WHEN setting::int = 0 THEN ' -4' END
         WHEN name = 'max_streams_per_query' THEN
             CASE WHEN setting::int = -1 THEN '50' END
         WHEN name = 'max_connections' THEN
             CASE WHEN node_name = 'dn_6001_6002' AND setting::int < 5000 THEN '>=5000' END
         ELSE ''
    END AS diagnosis
FROM pgxc_parallel_query('all', 'SELECT
    pgxc_node_str() AS node_name, name, setting, unit
FROM pg_settings 
WHERE pgxc_node_str() IN (''cn_5001'',''dn_6001_6002'')
AND name in (''max_streams_per_query'',''query_dop''
,''sql_use_spacelimit'',''temp_file_limit'',''default_distribution_mode'',
''autovacuum_mode'',''autovacuum'',''autovacuum_max_workers_hstore'',''autovacuum_max_workers'',
''session_timeout'',''statement_timeout'',''ddl_lock_timeout'',''idle_in_transaction_timeout'',
''max_connections'',''min_pool_size'',''max_pool_size'',
''max_stream_pool'',''max_active_statements'',''max_prepared_transactions'',
''cstore_buffers'',''shared_buffers'', ''max_process_memory'', ''udf_memory_limit'',
''max_process_memory_balanced'', ''bbox_dump_count'', ''enable_bbox_dump'')') 
AS (node_name name, name text, setting text, unit text)
ORDER BY node_name, name;

2. 大表檢查

目的:識別大表,建議客戶整改,避免磁碟過載

8.1.3版本使用如下SQL

SELECT
    CASE WHEN (skewsize > avgsize * 0.10 AND skewsize > 50 * 1024) THEN 'skew table'
        WHEN (reloptions::text LIKE '%orientation=column%' AND reloptions::text LIKE '%compression=no%') THEN 'uncompressed column table'
        WHEN (x.pclocatortype = 'R' AND avgsize > 10 * 1024) THEN 'large replicattion table'
        WHEN (pg_stat_get_dead_tuples(c.oid) >100000 AND pg_stat_get_dead_tuples(c.oid)/(pg_stat_get_dead_tuples(c.oid)+pg_stat_get_live_tuples(c.oid)) > 0.4) THEN 'dirty table'
        ELSE 'normal large table'
    END AS diagnostic,
    t1.schemaname,  -- 表的schema
    t1.tablename,   -- 表名
    a.rolname AS tableowner,
    x.pgroup AS nodegroup,
    CASE x.pclocatortype WHEN 'H' THEN 'Hash' 
        WHEN 'N' THEN 'Round Robin' 
        WHEN 'R' THEN 'Replicate' 
    END AS locatortype,
    CASE WHEN c.parttype = 'p' THEN true ELSE false END AS ispartitioned,
    CASE WHEN reloptions::text LIKE '%orientation=column%' THEN 'column'
         WHEN reloptions::text LIKE '%orientation=row%' THEN 'row'
    END AS orientation,
    t1.dnnum,                         -- 表的node group的DN數
    t1.totalsize AS "totalsize(MB)",  -- 表的size ,單位MB
    t1.avgsize AS "avgsize(MB)",      -- 平均每個DN上數據量,單位MB
    t1.skewsize AS "skewsize(MB)",    -- 不同DN上數據size的最大差值,單位MB
    t1.skewdn,                        -- 數據量最大的DN
    t1.maxratio,                      -- 數據量最大DN的size/平均size
    t1.minratio,                      -- 數據量最小DN的size/平均size
    t1.skewratio                      -- 不同DN上數據size的最大差值/平均size
FROM ( -- 預處理,識別傾斜表
    SELECT
        schemaname,
        tablename,
        skewdn,
        dnnum,
        totalsize,
        avgsize,
        skewsize,
        (maxsize/avgsize)::numeric(20,2) AS maxratio,
        (minsize/avgsize)::numeric(20,2) AS minratio,
        (skewsize/avgsize)::numeric(20,2) AS skewratio
    FROM (
        SELECT
            schemaname,tablename,skewdn,count(1) AS dnnum,sum(dnsize) AS totalsize,
            avg(dnsize) AS avgsize,max(dnsize) AS maxsize,min(dnsize) AS minsize, (max(dnsize) - min(dnsize)) AS skewsize
        FROM ( --對每個表的數據按照DN數據量大小排序,以及獲取傾斜的dn
            SELECT     
                schemaname,
                tablename,
                nodename,
                (dnsize/1024/1024)::bigint AS dnsize, -- 單位換算為MB
                first_value(nodename) over (PARTITION BY schemaname, tablename ORDER BY dnsize DESC, nodename) AS skewdn  -- --數據量最大的DN
            FROM ( -- 獲取大於10GB的表
                SELECT 
                    schemaname, tablename,(rd).nodename, ((rd).dnsize + 1) AS dnsize
                FROM (
                    SELECT
                        schemaname, tablename, gs_table_distribution(schemaname, tablename) AS rd
                    FROM gs_table_distribution()
                    WHERE schemaname NOT IN ('pg_catalog', 'dbms_om', 'cstore')
                    AND relkind = 'r'
                    GROUP BY schemaname, tablename
                    HAVING sum(dnsize) > 50.0 * 1024 * 1024 * 1024 -- 總大小大於100GB
                )
            )
        )
        GROUP BY schemaname,tablename, skewdn
    )
) t1
INNER JOIN pg_class c ON c.relname = t1.tablename
LEFT JOIN pg_namespace n ON n.nspname = t1.schemaname
LEFT JOIN pg_authid a ON a.oid = c.relowner
LEFT JOIN pgxc_class x ON x.pcrelid = c.oid
WHERE c.reloptions::text NOT LIKE '%internal_mask%'
ORDER BY totalsize DESC, diagnostic, skewsize DESC
;

8.2.1和8.2.0版本使用如下

-- 大表診斷
SELECT
    CASE WHEN (skewsize > avgsize * 0.10 AND skewsize > 50 * 1024) THEN 'skew table'
        WHEN (reloptions::text LIKE '%orientation=column%' AND reloptions::text LIKE '%compression=no%') THEN 'uncompressed column table'
        WHEN (x.pclocatortype = 'R' AND avgsize > 10 * 1024) THEN 'large replicattion table'
        WHEN (pg_stat_get_dead_tuples(c.oid) >100000 AND pg_stat_get_dead_tuples(c.oid)/(pg_stat_get_dead_tuples(c.oid)+pg_stat_get_live_tuples(c.oid)) > 0.4) THEN 'dirty table'
        WHEN (reloptions::text LIKE '%orientation=column%') THEN
            CASE WHEN (SELECT total_cu_count > 0 AND (zero_size_cu_count + small_cu_count)/total_cu_count > 0.5 FROM get_col_cu_info(t1.schemaname, t1.tablename)) THEN 'small cu table'
                ELSE 'normal large table'
            END
        ELSE 'normal large table'
    END AS diagnostic,
    t1.schemaname,  -- 表的schema
    t1.tablename,   -- 表名
    a.rolname AS tableowner,
    x.pgroup AS nodegroup,
    CASE x.pclocatortype WHEN 'H' THEN 'Hash' 
        WHEN 'N' THEN 'Round Robin' 
        WHEN 'R' THEN 'Replicate' 
    END AS locatortype,
    CASE WHEN c.parttype = 'p' THEN true ELSE false END AS ispartitioned,
    CASE WHEN reloptions::text LIKE '%orientation=column%' THEN 'column'
         WHEN reloptions::text LIKE '%orientation=row%' THEN 'row'
    END AS orientation,
    t1.dnnum,                         -- 表的node group的DN數
    t1.totalsize AS "totalsize(MB)",  -- 表的size ,單位MB
    t1.avgsize AS "avgsize(MB)",      -- 平均每個DN上數據量,單位MB
    t1.skewsize AS "skewsize(MB)",    -- 不同DN上數據size的最大差值,單位MB
    t1.skewdn,                        -- 數據量最大的DN
    t1.maxratio,                      -- 數據量最大DN的size/平均size
    t1.minratio,                      -- 數據量最小DN的size/平均size
    t1.skewratio                      -- 不同DN上數據size的最大差值/平均size
FROM ( -- 預處理,識別傾斜表
    SELECT
        schemaname,
        tablename,
        skewdn,
        dnnum,
        totalsize,
        avgsize,
        skewsize,
        (maxsize/avgsize)::numeric(20,2) AS maxratio,
        (minsize/avgsize)::numeric(20,2) AS minratio,
        (skewsize/avgsize)::numeric(20,2) AS skewratio
    FROM (
        SELECT
            schemaname,
            tablename,
            skewdn,
            count(1) AS dnnum,
            sum(dnsize) AS totalsize,
            avg(dnsize) AS avgsize,
            max(dnsize) AS maxsize,
            min(dnsize) AS minsize,
            (max(dnsize) - min(dnsize)) AS skewsize
        FROM ( --對每個表的數據按照DN數據量大小排序,以及獲取傾斜的dn
            SELECT     
                schemaname,
                tablename,
                nodename,
                (dnsize/1024/1024)::bigint AS dnsize, -- 單位換算為MB
                first_value(nodename) over (PARTITION BY schemaname, tablename ORDER BY dnsize DESC, nodename) AS skewdn  -- --數據量最大的DN
            FROM ( -- 獲取大於10GB的表
                SELECT 
                    schemaname, tablename,(rd).nodename, ((rd).dnsize + 1) AS dnsize
                FROM (
                    SELECT
                        schemaname, tablename, gs_table_distribution(schemaname, tablename) AS rd
                    FROM gs_table_distribution()
                    WHERE schemaname NOT IN ('pg_catalog', 'dbms_om', 'cstore')
                    AND relkind = 'r'
                    GROUP BY schemaname, tablename
                    HAVING sum(dnsize) > 50* 1024 * 1024 * 1024.0 -- 總大小大於100GB
                )
            )
        )
        GROUP BY schemaname,tablename, skewdn
    )
) t1
INNER JOIN pg_class c ON c.relname = t1.tablename
LEFT JOIN pg_namespace n ON n.nspname = t1.schemaname
LEFT JOIN pg_authid a ON a.oid = c.relowner
LEFT JOIN pgxc_class x ON x.pcrelid = c.oid
WHERE c.reloptions::text NOT LIKE '%internal_mask%'
ORDER BY totalsize DESC, diagnostic, skewsize DESC
;

8.3.0版本使用

-- 大表診斷
SELECT
    CASE WHEN (skewsize > avgsize * 0.10 AND skewsize > 50 * 1024) THEN 'skew table'
        WHEN (reloptions::text LIKE '%orientation=column%' AND reloptions::text LIKE '%compression=no%') THEN 'uncompressed column table'
        WHEN (x.pclocatortype = 'R' AND avgsize > 10 * 1024) THEN 'large replicattion table'
        WHEN (pg_stat_get_dead_tuples(c.oid) >100000 AND pg_stat_get_dead_tuples(c.oid)/(pg_stat_get_dead_tuples(c.oid)+pg_stat_get_live_tuples(c.oid)) > 0.4) THEN 'dirty table'
        WHEN (reloptions::text LIKE '%orientation=column%') THEN
            CASE WHEN (SELECT total_cu_count > 0 AND (zero_cu_count + small_cu_count)/total_cu_count > 0.5 FROM pgxc_get_small_cu_info(c.oid)) THEN 'small cu table'
                ELSE 'normal large table'
            END
        ELSE 'normal large table'
    END AS diagnostic,
    t1.schemaname,  -- 表的schema
    t1.tablename,   -- 表名
    a.rolname AS tableowner,
    x.pgroup AS nodegroup,
    CASE x.pclocatortype WHEN 'H' THEN 'Hash' 
        WHEN 'N' THEN 'Round Robin' 
        WHEN 'R' THEN 'Replicate' 
    END AS locatortype,
    CASE WHEN c.parttype = 'p' THEN true ELSE false END AS ispartitioned,
    CASE WHEN reloptions::text LIKE '%orientation=column%' THEN 'column'
         WHEN reloptions::text LIKE '%orientation=row%' THEN 'row'
    END AS orientation,
    t1.dnnum,                         -- 表的node group的DN數
    t1.totalsize AS "totalsize(MB)",  -- 表的size ,單位MB
    t1.avgsize AS "avgsize(MB)",      -- 平均每個DN上數據量,單位MB
    t1.skewsize AS "skewsize(MB)",    -- 不同DN上數據size的最大差值,單位MB
    t1.skewdn,                        -- 數據量最大的DN
    t1.maxratio,                      -- 數據量最大DN的size/平均size
    t1.minratio,                      -- 數據量最小DN的size/平均size
    t1.skewratio                      -- 不同DN上數據size的最大差值/平均size
FROM ( -- 預處理,識別傾斜表
    SELECT
        schemaname,
        tablename,
        skewdn,
        dnnum,
        totalsize,
        avgsize,
        skewsize,
        (maxsize/avgsize)::numeric(20,2) AS maxratio,
        (minsize/avgsize)::numeric(20,2) AS minratio,
        (skewsize/avgsize)::numeric(20,2) AS skewratio
    FROM (
        SELECT
            schemaname,
            tablename,
            skewdn,
            count(1) AS dnnum,
            sum(dnsize) AS totalsize,
            avg(dnsize) AS avgsize,
            max(dnsize) AS maxsize,
            min(dnsize) AS minsize,
            (max(dnsize) - min(dnsize)) AS skewsize
        FROM ( --對每個表的數據按照DN數據量大小排序,以及獲取傾斜的dn
            SELECT     
                schemaname,
                tablename,
                nodename,
                (dnsize/1024/1024)::bigint AS dnsize, -- 單位換算為MB
                first_value(nodename) over (PARTITION BY schemaname, tablename ORDER BY dnsize DESC, nodename) AS skewdn  -- --數據量最大的DN
            FROM ( -- 獲取大於10GB的表
                SELECT 
                    schemaname, tablename,(rd).nodename, ((rd).dnsize + 1) AS dnsize
                FROM (
                    SELECT
                        schemaname, tablename, gs_table_distribution(schemaname, tablename) AS rd
                    FROM gs_table_distribution()
                    WHERE schemaname NOT IN ('pg_catalog', 'dbms_om', 'cstore')
                    AND relkind = 'r'
                    GROUP BY schemaname, tablename
                    HAVING sum(dnsize) > 50.0 * 1024 * 1024 * 1024 -- 總大小大於100GB
                )
            )
        )
        GROUP BY schemaname,tablename, skewdn
    )
) t1
INNER JOIN pg_class c ON c.relname = t1.tablename
LEFT JOIN pg_namespace n ON n.nspname = t1.schemaname
LEFT JOIN pg_authid a ON a.oid = c.relowner
LEFT JOIN pgxc_class x ON x.pcrelid = c.oid
WHERE c.reloptions::text NOT LIKE '%internal_mask%'
ORDER BY totalsize DESC, diagnostic, skewsize DESC
;

針對不同的診斷結果使用如下診斷措施

類別

建議手段

skew table

根據業務選擇關聯常用,並且數據不傾斜的列作為修改分佈列,如果找不到合適的分佈列,可以把表修改為RoundRobin分佈

ALTER TABLE ctmes_tgmesmbi.mbi_hlottsthisDISTRIBUTE BY ROUNDROBIN;複製
  • 註意:修改分佈列的過程中此表存在雙份數據,因此要預留足夠的磁碟空間,防止導致磁碟空間過載。
  • ALTER TABLE修改分佈列對錶持8級鎖,阻塞此表的SELECT、UPDATE、DELETE、INSERT等操作

uncompressed column table

列存表的壓縮效果非常好,一般推薦使用壓縮,至少使用low級別壓縮

ALTER TABLE customer_address SET(compression=low);
VACUUM FULL customer_address;複製
  • 註意,VACUUM FULL的過程中此表存在雙份數據,因此要預留足夠的磁碟空間,防止VACUUM FULL過程中導致磁碟空間過載。
  • VACUUM FULL對錶持8級鎖,阻塞此表的SELECT、UPDATE、DELETE、INSERT等操作

dirty table

說明表檢測碎片率比較高,需要通過VACUUM整理表

VACUUM FULL customer_address;複製
  • VACUUM FULL的過程中此表存在雙份數據,因此要預留足夠的磁碟空間,防止VACUUM FULL過程中導致磁碟空間過載。
  • VACUUM FULL對錶持8級鎖,阻塞此表的SELECT、UPDATE、DELETE、INSERT等操作

small cu table

說明表小CU比較多,需要通過VACUUM整理表

VACUUM FULL customer_address;複製
  • VACUUM FULL的過程中此表存在雙份數據,因此要預留足夠的磁碟空間,防止VACUUM FULL過程中導致磁碟空間過載。
  • VACUUM FULL對錶持8級鎖,阻塞此表的SELECT、UPDATE、DELETE、INSERT等操作

large replicattion table

複製表在每個DN上都有一份全量數據,當表磁碟空間占用過大時,需要把表修改為HASH表。一般複製表都是維表,存在主鍵,直接把分佈列修改為主鍵

ALTER TABLE ctmes_tgmesmbi.mbi_hlottsthisDISTRIBUTE BY HASH(id);複製

normal large table

 

3. 冗餘索引診斷

目的:識別冗餘索引,建議客戶刪除。可以降低磁碟空間,並降低大規模數據導入的時候的xlog規模

-- optimizable policy為duplicate的檢查項
--        表明兩個索引欄位和欄位順序完全一致
--         建議直接刪除optimizable index指定的索引;
-- optimizable policy為redundancy檢查項表明
--         optimizable index指定的索引的索引列剛好是base index的索引列的前面欄位
--         建議直接刪除optimizable index指定的索引;
-- optimizable policy為optimizable檢查項
--         表明optimizable index和base index這兩個索引的索引列完全重覆,但是索引列的順序不一致
--         這種場景需要人工介入分析是否可以優化
WITH info AS(
    SELECT 
        quote_ident(n.nspname) || '.' || quote_ident(c.relname) AS tablename,
        pgroup AS nodegroup,
        x.indrelid AS indrelid,
        x.indexrelid AS indexrelid,
        indisunique,
        indisprimary,
        indnatts,
        indkey,
        indexprs
    FROM pg_index x
    INNER JOIN pg_class c ON c.oid = x.indrelid
    INNER JOIN pg_class i ON i.oid = x.indexrelid
    LEFT JOIN pg_namespace n ON n.oid = c.relnamespace
    INNER JOIN pgxc_class xc ON xc.pcrelid = c.oid
    WHERE c.relkind = 'r' AND c.oid >= 16384 AND (c.reloptions IS NULL OR c.reloptions::text NOT LIKE '%internal_mask%')
    AND i.relkind = 'i' AND i.oid >= 16384
    AND x.indpred IS NULL
),

base AS(
    SELECT
        tablename,
        nodegroup,
        i.indrelid,
        i.indexrelid baseidx,
        i.indisunique AS base_unique,
        i.indisprimary AS base_primary,
        x.indexrelid AS optidx,
        x.indisunique AS opt_unique,
        x.indisprimary AS opt_primary,
        CASE WHEN opt_primary > base_primary OR opt_unique > base_unique THEN true ELSE false END AS swap,
        CASE WHEN i.indkey = x.indkey AND coalesce(pg_get_expr(i.indexprs, i.indrelid), 'NULL') = coalesce(pg_get_expr(x.indexprs, x.indrelid), 'NULL') THEN 'duplicate'::text
            WHEN x.indexprs IS NOT NULL OR i.indexprs IS NOT NULL THEN NULL::text
            WHEN strpos(i.indkey::text, x.indkey::text||' ') = 1 OR strpos(x.indkey::text, i.indkey::text||' ') = 1 THEN 'redundancy'::text
            WHEN i.indkey @> x.indkey AND x.indkey @> i.indkey THEN 'optimizable'::text
            ELSE NULL
        END AS optpolicy
    FROM info i
    INNER JOIN pg_index x ON (i.indrelid = x.indrelid AND i.indexrelid > x.indexrelid)
    WHERE x.indpred IS NULL AND optpolicy IS NOT NULL
),

tmp AS(
    SELECT
        tablename,
        indrelid,
        nodegroup,
        CASE WHEN swap THEN optidx       ELSE baseidx      END AS base_idx,
        CASE WHEN swap THEN opt_primary  ELSE base_primary END AS base_primary,
        CASE WHEN swap THEN opt_unique   ELSE base_unique  END AS base_unique,
        CASE WHEN swap THEN baseidx      ELSE optidx       END AS opt_idx,
        CASE WHEN swap THEN base_primary ELSE opt_primary  END AS opt_primary,
        CASE WHEN swap THEN base_unique  ELSE opt_unique   END AS opt_unique,
        optpolicy
    FROM base
)

SELECT
    tablename,
    nodegroup,
    base_idx::regclass::text AS base_index,
    base_primary,
    base_unique,
    substring(pg_get_indexdef(base_idx) from 'USING .+\)') AS base_idxdef,
    opt_idx::regclass::text AS opt_index,
    opt_primary,
    opt_unique,
    substring(pg_get_indexdef(opt_idx) from 'USING .+\)') AS opt_idxdef,
    optpolicy,
    pg_get_tabledef(indrelid)
FROM tmp
ORDER BY 1, 2, 3
;

 

點擊關註,第一時間瞭解華為雲新鮮技術~ 

 


您的分享是我們最大的動力!

-Advertisement-
Play Games
更多相關文章
  • 痞子衡嵌入式半月刊: 第 95 期 這裡分享嵌入式領域有用有趣的項目/工具以及一些熱點新聞,農曆年分二十四節氣,希望在每個交節之日準時發佈一期。 本期刊是開源項目(GitHub: JayHeng/pzh-mcu-bi-weekly),歡迎提交 issue,投稿或推薦你知道的嵌入式那些事兒。 上期回顧 ...
  • 實驗環境: 兩台windows servers 一臺已經配置了FTP伺服器,IP為192.168.1.220,vmnet1 一臺作為客戶端測試,IP為192.168.1.138,vmnet1 一:FTP IP限制 1.關閉ftp伺服器端防火牆,使客戶端能pin通伺服器端 2.在客戶端資源管理器輸入f ...
  • 實驗環境: windows server虛擬機一臺 網路適配器:vmnet1 ip:192.168.1.220 一.安裝FTP服務 打開伺服器管理器 點擊添加角色,勾IIS,點擊下一步直到對話框消失 勾選FTP 從開始菜單找到管理工具 打開IIS 可以看見ftp服務的相關信息,說明安裝成功 二:新建 ...
  • 目錄一、zabbix部署1、安裝zabbix服務端2、準備資料庫(mariadb簡單點)3、修改服務的配置二、登錄zabbix三、客戶端配置1、安裝軟體包2、修改配置文件3、啟動客戶端服務四、報錯解決五、添加監控主機1、安裝軟體包2、修改配置文件3、啟動客戶端服務4、回到zabbix添加主機5、添加 ...
  • 想使用串口,找了半天也沒找到它所給的pin的使用示例,淘寶客服說只是硬體相容樹莓派。 想來想去,還是直接接個USB串口最方便。 但是插上不識別,說明沒有驅動。 直接在板子上編譯沒有header依賴,後續下載華碩對應的arm依賴能編譯但是驅動不能正常使用。 就在所給虛擬機上交叉編譯。 先按照手冊配置好 ...
  • innodb_log_file_size 和 innodb_buffer_pool_size 是 MySQL 資料庫中 InnoDB 存儲引擎的兩個重要配置參數。它們對資料庫的性能和可靠性有著顯著的影響。 1. innodb_log_file_size innodb_log_file_size 參數 ...
  • 前言: 在廣州這座城市下著小雨的晚上,我正在廚房洗著碗,突然手機有來電,脫下手套,一看是來自阿裡雲的告警電話。打開飛書查看告警內容,發現某個業務的RDS只讀實例CPU飈到100%,下意識覺得是不是有慢查詢導致,想著不會有啥問題,上去kill慢查就好了,結果發現是大問題....一、發現問題 2024年 ...
  • 我司使用Apache DolphinScheduler作為調度框架很久了,感興趣的小伙伴可以看看這些乾貨文章: 因為之前監控到會出現重覆的調度的問題,所以此文記錄排查重覆調度問題的全過程,希望對社區其他的小伙伴能夠起到拋磚引玉的作用! 註:本文使用的DolphinScheduler 3.1.1的版本 ...
一周排行
    -Advertisement-
    Play Games
  • PasteSpider是什麼? 一款使用.net編寫的開源的Linux容器部署助手,支持一鍵發佈,平滑升級,自動伸縮, Key-Value配置,項目網關,環境隔離,運行報表,差量升級,私有倉庫,集群部署,版本管理等! 30分鐘上手,讓開發也可以很容易的學會在linux上部署你得項目! [從需求角度介 ...
  • SQLSugar是什麼 **1. 輕量級ORM框架,專為.NET CORE開發人員設計,它提供了簡單、高效的方式來處理資料庫操作,使開發人員能夠更輕鬆地與資料庫進行交互 2. 簡化資料庫操作和數據訪問,允許開發人員在C#代碼中直接操作資料庫,而不需要編寫複雜的SQL語句 3. 支持多種資料庫,包括但 ...
  • 在C#中,經常會有一些耗時較長的CPU密集型運算,因為如果直接在UI線程執行這樣的運算就會出現UI不響應的問題。解決這類問題的主要途徑是使用多線程,啟動一個後臺線程,把運算操作放在這個後臺線程中完成。但是原生介面的線程操作有一些難度,如果要更進一步的去完成線程間的通訊就會難上加難。 因此,.NET類 ...
  • 一:背景 1. 講故事 前些天有位朋友在微信上丟了一個崩潰的dump給我,讓我幫忙看下為什麼出現了崩潰,在 Windows 的事件查看器上顯示的是經典的 訪問違例 ,即 c0000005 錯誤碼,不管怎麼說有dump就可以上windbg開幹了。 二:WinDbg 分析 1. 程式為誰崩潰了 在 Wi ...
  • CSharpe中的IO+NPOI+序列化 文件文件夾操作 學習一下常見的文件、文件夾的操作。 什麼是IO流? I:就是input O:就是output,故稱:輸入輸出流 將數據讀入記憶體或者記憶體輸出的過程。 常見的IO流操作,一般說的是[記憶體]與[磁碟]之間的輸入輸出。 作用 持久化數據,保證數據不再 ...
  • C#.NET與JAVA互通之MD5哈希V2024 配套視頻: 要點: 1.計算MD5時,SDK自帶的計算哈希(ComputeHash)方法,輸入輸出參數都是byte數組。就涉及到字元串轉byte數組轉換時,編碼選擇的問題。 2.輸入參數,字元串轉byte數組時,編碼雙方要統一,一般為:UTF-8。 ...
  • CodeWF.EventBus,一款靈活的事件匯流排庫,實現模塊間解耦通信。支持多種.NET項目類型,如WPF、WinForms、ASP.NET Core等。採用簡潔設計,輕鬆實現事件的發佈與訂閱。通過有序的消息處理,確保事件得到妥善處理。簡化您的代碼,提升系統可維護性。 ...
  • 一、基本的.NET框架概念 .NET框架是一個由微軟開發的軟體開發平臺,它提供了一個運行時環境(CLR - Common Language Runtime)和一套豐富的類庫(FCL - Framework Class Library)。CLR負責管理代碼的執行,而FCL則提供了大量預先編寫好的代碼, ...
  • 本章將和大家分享在ASP.NET Core中如何使用高級客戶端NEST來操作我們的Elasticsearch。 NEST是一個高級別的Elasticsearch .NET客戶端,它仍然非常接近原始Elasticsearch API的映射。所有的請求和響應都是通過類型來暴露的,這使得它非常適合快速上手 ...
  • 參考delphi的代碼更改為C# Delphi 檢測密碼強度 規則(仿 google) 仿 google 評分規則 一、密碼長度: 5 分: 小於等於 4 個字元 10 分: 5 到 7 字元 25 分: 大於等於 8 個字元 二、字母: 0 分: 沒有字母 10 分: 全都是小(大)寫字母 20 ...