Kernel Major Version | Earliest Supported Version |
PostgreSQL 14 | v14.19_r1.38 or later |
PostgreSQL 15 | v15.14_r1.23 or later |
PostgreSQL 16 | v16.10_r1.18 or later |
PostgreSQL 17 | v17.6_r1.12 or later |
PostgreSQL 18 | v18.1_r1.2 or later |
SHOW tencentdb_version;.tencentdb_auto_kill_xact_max_age in Parameter Settings, modify it to the target value, and save the changes. The parameter modification takes effect through configuration hot reload, and no instance restart is required.Parameter Name | Type | Default Value | Value Range | Description |
tencentdb_auto_kill_xact_max_age | integer | 2000000000 | [100000, 2000000000] | The age threshold for automatically killing XIDs. A value of 2000000000 disables this feature. The actual trigger threshold is the maximum of this value and autovacuum_freeze_max_age. |
tencentdb_auto_kill_xact_max_age and autovacuum_freeze_max_age to the same value (for example, 200000000), enabling the automatic Kill and VACUUM freeze to work in coordination at the same threshold.autovacuum_freeze_max_age, you must also lower autovacuum_freeze_max_age (the actual trigger threshold will not be lower than this value).pg_sleep) in a session.pg_stat_activity.autovacuum kill old transaction, sending SIGTERM to PID <PID>, xmin is <XMIN>, xid is <XID>
tencentdb_system_stat extension. You need to complete the following two configuration steps:shared_preload_libraries in Parameter Settings, add tencentdb_system_stat to its value (separate multiple values with commas), save the changes, and then restart the instance for the changes to take effect.postgres=> SHOW shared_preload_libraries;shared_preload_libraries--------------------------------------pg_stat_statements,tencentdb_system_stat(1 row)
Parameter Name | Type | Default Value | Value Range | Description |
tencentdb_system_stat.max_process_memory_limit | integer (MB) | 10000000 | [100, 10000000] | The maximum memory usage allowed for a single session. When the value is 10000000 (approximately 10TB), it indicates that this feature is disabled. |
tencentdb_system_stat.check_process_memory_interval | integer (ms) | 5000 | [100, 2147483] | The interval for memory checking, which is the number of milliseconds between each scan of memory usage for all sessions. |
max_process_memory_limit based on the baseline memory consumption of your business SQL. For example, you can set it to 1–2 GB (1024–2048) for OLTP scenarios, and relax it appropriately for OLAP scenarios./proc file system. Sessions that exceed the threshold are terminated by sending a SIGTERM signal (the effect is equivalent to pg_terminate_backend).postgres user are not automatically killed.max_process_memory_limit threshold.Kill process <PID>, memory usage <bytes> bytes exceed max_allowed_bytes <bytes>kill process <PID> success
tencentdb_auto_kill_xact_max_age is set?autovacuum is on. The automatic kill of long-running transactions relies on the scheduling of the autovacuum worker. If autovacuum is disabled, the kill will not be triggered.max(tencentdb_auto_kill_xact_max_age, autovacuum_freeze_max_age). If the value you set is less than autovacuum_freeze_max_age, the value that actually takes effect is still the latter one. It is recommended to keep the two parameters consistent.tencentdb_system_stat.check_process_memory_interval and tencentdb_system_stat.max_process_memory_limit are both SIGHUP-level parameters. They take effect after you execute pg_reload_conf() or save the changes in the console, without requiring an instance restart. Ensure that shared_preload_libraries already contains tencentdb_system_stat (modifying this parameter requires a restart).tencentdb_auto_kill_xact_max_age and the tencentdb_system_stat.* series do not support modification via the session-level SET command. Please perform the operation on the parameter settings page in the Tencent Cloud console.文档反馈