Updated on 2024-06-03 GMT+08:00

System Performance Snapshot

enable_wdr_snapshot

Parameter description: Specifies whether to enable the database monitoring snapshot function.

Parameter type: Boolean

Unit: none

Value range:

  • on indicates that the database monitoring snapshot function is enabled.
  • off indicates that the database monitoring snapshot function is disabled.

Default value: on

Setting method: This is a SIGHUP parameter. Set it based on instructions provided in Table 1.

Setting suggestion: Retain the default value.

You are advised not to enable it in the following scenarios:

  • In multi-table and multi-database scenarios, WDR snapshot records snapshots in each database in serial mode, which takes a long time. Therefore, you are advised not to enable it.
  • In the multi-table scenario, the query speed of the pg_stat_all_tables is slow due to the performance problems of some internal tables. In this case, the WDR snapshot function is slow. Therefore, you are advised not to enable it.
  • If WDR snapshot is performed when there are a large number of DDL statements, WDR snapshot may fail. Therefore, you are advised not to enable it.

enable_wdr_snapshot_standby

Parameter description: Specifies whether to enable the database monitoring snapshot function on the standby node.

Parameter type: Boolean

Unit: none

Value range:

  • on indicates that the database monitoring snapshot function is enabled on the standby node.
  • off indicates that the database monitoring snapshot function is disabled on the standby node.

Default value: off

Setting method: This is a SIGHUP parameter. Set it based on instructions provided in Table 1.

Setting suggestion: Retain the default value. If you want to adjust the value, make sure you understand the parameter meaning and adjust the value with caution to avoid risks caused by misoperations.

enable_show_standby_name

Parameter description: Specifies whether to display the names that distinguish the primary and standby nodes of the same shard. After this function is enabled, different names are returned when dbe_perf.node_name is queried on different nodes of the same shard.

This is a USERSET parameter. Set it based on instructions provided in Table 1.

Value range: Boolean

  • on: The function of distinguishing primary and standby node names is enabled.
  • off: The function of distinguishing primary and standby node names is disabled.

Default value: off

wdr_snapshot_retention_days

Parameter description: Specifies the number of days database monitoring snapshots are retained. If the number of snapshots generated during database running exceeds the maximum number of snapshots that can be generated within the retention period (24 x 8 = 192 by default), the system deletes the snapshots with the smallest ID at an interval specified by the value of wdr_snapshot_interval.

This parameter is valid only when enable_wdr_snapshot is set to on.

Parameter type: integer

Unit: day

Value range: 1 to 30

Default value: 8

Setting method: This is a SIGHUP parameter. Set it based on instructions provided in Table 1.

Setting suggestion: Retain the default value. A larger parameter value indicates higher disk usage.

wdr_snapshot_query_timeout

Parameter description: Specifies the execution timeout for the SQL statements associated with database monitoring snapshot operations. If the statement execution is not complete and no result is returned within the specified time, the snapshot operation fails.

This is a SIGHUP parameter. Set it based on instructions provided in Table 1. The value 0 indicates that this parameter does not take effect.

Value range: an integer ranging from 0 to INT_MAX. The unit is second.

Default value: 100s

wdr_snapshot_interval

Parameter description: Specifies the interval at which the backend thread snapshot automatically takes snapshots of the database monitoring data.

This parameter is valid only when enable_wdr_snapshot is set to on.

Parameter type: integer

Unit: minute

Value range: 10 to 60

Default value: 60

Setting method: This is a SIGHUP parameter. Set it based on instructions provided in Table 1. For example, if the value is 60 without a unit, wdr_snapshot_interval indicates 60 minutes. If the value is 1h, wdr_snapshot_interval indicates 1 hour. If the unit is required, the value must be min, h, or d.

Setting suggestion: Retain the default value. If the retention period is fixed, a smaller value of this parameter indicates a larger disk usage.

wdr_snapshot_space_threshold

Parameter description: Specifies the threshold at which the space used by snapshots is controlled. When the space used by snapshots reaches 50% of the value of this parameter, the control logic of the database is enabled to stabilize the space used by the snapshots.

  • This parameter is valid only when enable_wdr_snapshot is set to on.
  • If this parameter is set to a value smaller than the space used by the snapshots, the space usage does not shrink. Instead, the control logic is enabled to control the snapshot growth and stabilize the space used by the snapshots.

Parameter type: integer

Unit: KB

Value range: 0–107374182400

Default value: 0, indicating that the function of controlling the space used by snapshots based on the space threshold is disabled.

Setting method: This is a SIGHUP parameter. Set it based on instructions provided in Table 1.

Setting suggestion: Set this parameter based on the actual scenario.

wdr_snapshot_full_backup_interval

Parameter description: Specifies the interval at which a full WDR snapshot is created. The interval specified by this parameter is about a number instead of time. For example, if the parameter is set to 12, a full snapshot and then 11 incremental snapshots are generated for each group. If the parameter is set to 1, all snapshots generated are full snapshots.

  • This parameter is valid only when enable_wdr_snapshot is set to on.
  • If you change the value of this parameter after multiple snapshots have been generated, the next snapshot will be a full snapshot. For example, after five WDR incremental snapshots have been generated, if the parameter value is changed to 10, a full snapshot will be generated before a new interval starts.
  • When a snapshot is deleted, other snapshots in the same group are deleted. The number of snapshots to be deleted depends on the value of this parameter when the earliest group of snapshots are generated and is irrelevant to the current value.

Parameter type: integer

Unit: none

Value range: 1 to 24

Default value: 12

Setting method: This is a SIGHUP parameter. Set it based on instructions provided in Table 1.

Setting suggestion: Set this parameter based on the actual scenario. If this parameter is set to a smaller value, more full snapshots are generated, but fewer snapshots that can be retained with the same space used.

asp_flush_mode

Parameter description: Specifies the mode for the ASP to update data to the disk. The value can be 'file' (default value), 'table' (system catalog), or 'all' (system catalog and file). Only the sysadmin user can access this parameter.

This is a SIGHUP parameter. Set it based on instructions provided in Table 1.

Value range: a string, which can be 'table', 'file', or 'all'

Default value: 'table'

asp_flush_rate

Parameter description: When the number of samples reaches the value of asp_sample_num, the samples in the memory are updated to the disk based on a certain proportion. asp_flush_rate indicates the update proportion. If this parameter is set to 10, it indicates that the update ratio is 10:1.

Parameter type: integer

Unit: none

Value range: 1 to 10

Default value: 10

Setting method: This is a SIGHUP parameter. Set it based on instructions provided in Table 1.

asp_log_filename

Parameter description: Specifies the file name format when writing files using ASP. Only the sysadmin user can access this parameter.

This is a SIGHUP parameter. Set it based on instructions provided in Table 1.

Value range: a string

Default value: "asp-%Y-%m-%d_%H%M%S.log"

asp_retention_days

Parameter description: Specifies the maximum number of days for reserving ASP samples when they are written to the system catalog.

This is a SIGHUP parameter. Set it based on instructions provided in Table 1.

Value range: an integer ranging from 1 to 7

Default value: 2

asp_sample_interval

Parameter description: Specifies the sampling interval.

Parameter type: integer

Unit: second

Value range: 1 to 10

Default value: 1

Setting method: This is a SIGHUP parameter. Set it based on instructions provided in Table 1.

asp_sample_num

Parameter description: Specifies the maximum number of samples allowed in the LOCAL_ACTIVE_SESSION view. Only the sysadmin user can access this parameter.

Parameter type: integer

Unit: none

Value range: 10 to 100000

Default value: 100000 (196-core CPU/1536 GB memory, 128-core CPU/1024 GB memory, 104-core CPU/1024 GB memory, 96-core CPU/1024 GB memory, 96-core CPU/768 GB memory, 80-core CPU/640 GB memory, 64-core CPU/512 GB memory, 60-core CPU/480 GB memory, 32-core CPU/256 GB memory, 16-core CPU/128 GB memory, 8-core CPU/64 GB memory, 4-core CPU/32 GB memory); 36000 (4-core CPU/16 GB memory)

Setting method: This is a POSTMASTER parameter. Set it based on instructions provided in Table 1.

Setting suggestion: Retain the default value. If you want to adjust the value, make sure you understand the parameter meaning and adjust the value with caution to avoid risks caused by misoperations.

enable_asp

Parameter description: Specifies whether to enable the active session profile function.

This is a SIGHUP parameter. Set it based on instructions provided in Table 1.

Value range: Boolean

  • on: The active session profile function is enabled.
  • off: The active session profile function is disabled.

Default value: on

gs_perf_interval

Parameter description: Specifies the interval at which the stacks are collected automatically. For details about the automatic stack collection function determined by this parameter, see "Maintainability > Built-in perf Tool" in Feature Description.

Parameter type: integer

Unit: minute

Value range: 0 or 5–60. The value 0 indicates that the automatic stack collection function is disabled. The values 5 to 60 indicate the interval at which the stacks are collected automatically.

If you attempt to set this parameter to a value ranging from 1 to 4, this parameter will be automatically adjusted to the default value 5.

Default value: 5

Setting method: This is a SIGHUP parameter. Set it based on instructions provided in Table 1.

Setting suggestion: Retain the default value.

gs_perf_retention_days

Parameter description: Specifies the retention period of flame graph files. For details about the automatic stack collection function determined by this parameter, see "Maintainability > Built-in perf Tool" in Feature Description.

Parameter type: integer

Unit: day

Value range: 1 to 8

Default value: 3

Setting method: This is a SIGHUP parameter. Set it based on instructions provided in Table 1.

Setting suggestion: Retain the default value.