Updated on 2025-11-24 GMT+08:00

Generating a Workload Diagnosis Report

Scenarios

You can collect and download workload diagnosis reports (WDRs) on the GaussDB console.

Constraints

The DB engine version of GaussDB instances must be V2.0-3.100 or later, and the kernel version must be 503.0 or later. For details about how to query the version, see Checking the DB Engine and Kernel Engine Version of a GaussDB Instance.

Precautions

  • Nodes cannot be rebooted between two snapshots.
  • Primary/Standby switchovers cannot be performed between two snapshots.
  • Databases cannot be deleted between two snapshots.
  • Performance metrics cannot be reset between two snapshots.
  • The snapshots cannot be taken before and after WDR generation is enabled on the standby node (enable_wdr_snapshot_standby is set to on).
  • The standby node cannot be a DCF or logger node, as they do not support WDR.
  • If a generated WDR contains negative values, the relevant metrics cannot reflect database performance.
  • The time required for generating a report depends on the amount of performance data in the snapshots. In most cases, a report can be generated within a few minutes. If a report cannot be generated within 5 minutes, use ANALYZE | ANALYSE to collect statistics on tables in the snapshot schema (starting with snap_global_statio_all_tables and snap_global_statio_all_indexes), and then generate the report again. For details about how to use the ANALYZE | ANALYSE syntax, see "SQL Reference" > "SQL Syntax" > "A" > "ANALYZE | ANALYSE" in Developer Guide. Alternatively, set a session-level statement timeout (using SET statement_timeout=*) to terminate report generation.
  • To generate a report, the client's character set should match GaussDB's character set. (You can set the client character set by executing SET client_encoding TO *.)
  • A node-level report contains all report information. The cluster report API is reserved for forward compatibility and is not recommended for problem analysis.
  • After wdr_snapshot_query_timeout is set, if the execution time of a statement in a WDR snapshot exceeds the value of this parameter, the statement fails to be executed and a message is recorded in the log. The generated report also records the message. If the timeout occurs, adjust the parameter value.
  • When enable_wdr_snapshot_standby is set to on, the WDR snapshot collects performance data from both the primary and standby nodes in serial mode and stores the data in the snapshot schema of the system database on the primary node. Each snapshot consumes network resources between the primary and standby nodes. The overall snapshot time increases with the number of nodes to be collected. The disk size occupied by snapshot tables also increases with the number of nodes.
  • If DROP PARTITION, SPLIT PARTITION, or MERGE PARTITION operations are performed on partitioned tables between two snapshots, accumulated statistics on Object Stats and Cache IO Stats in the WDR may be inaccurate.
  • The version columns of the two snapshots in the snapshot.snapshot table must be the same.
  • The SELECT generate_wdr_report(begin_snap_id bigint, end_snap_id bigint, report_type cstring, report_scope cstring, node_name cstring); command cannot be executed on the standby node.
  • In a streaming replication-based remote DR solution, the RPO is not 0 when a standby instance (also referred to as a DR instance) is promoted to primary. As a result, the snapshot ID may not increase in ascending order.
  • The DB instance cannot be read-only.
  • The DB instance cannot be a DR instance.
  • To generate a snapshot immediately without waiting for the specified generation interval, click Create Snapshot.
  • By default, snapshots are generated every 60 minutes. Set the collection period based on the specified generation interval. If the specified period is shorter than the interval, the collection fails.
  • If the number of generated snapshots exceeds the maximum number allowed within the retention period (24 x 8 = 192 by default), each time a new snapshot is generated, the system deletes the snapshot with the lowest snapshot ID.
  • Snapshot collection may fail if the data is collected when a large number of DDL statements are executed.
  • If a DB instance contains a large number of databases or tables, it takes a long time to collect snapshot data.
  • The kernel collects data from DNs by shard. If you select one DN in a shard in a WDR report, data of all DNs in that shard will be displayed. Assume that dn_6001, dn_6002, and dn_6003 belong to the same shard. If dn_6001 is selected for data collection, dn_6001_6002_6003 is displayed in the report.

Procedure

  1. Log in to the management console.
  2. Click in the upper left corner and select a region and project.
  3. Click in the upper left corner of the page and choose Databases > GaussDB.
  4. On the Instances page, click the name of the target instance to go to the Basic Information page.
  5. In the navigation pane, choose Diagnostics and Optimization > Performance Reports.

  6. Specify the snapshot collection period as required and click Create Snapshot.

    This operation will trigger a full WDR snapshot query to retrieve all available completed snapshots within the specified period. Any time ranges that include kernel reset events (node restarts, primary/standby switchovers, RESET operations on performance metrics, or DROP DATABASE operations) will be excluded. The system then displays all available snapshot ranges.

  7. Specify Collection Type.

    • In the Collection Type field, select a type as required.

      Instance level and Component level are available. You can change selected components if Component level is selected.

    Figure 1 WDR task configuration

  8. Click Collect to submit the snapshot collection and WDR report creation task.
  9. View the WDR task list and wait until the task is created.

    • If the collection status is Successful, click Download WDR to obtain the performance report of the specified period.
      Figure 2 WDR task list

    • If the collection status is Failed, contact Huawei Cloud customer service.