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

Global SysCache Parameters

enable_global_syscache

Parameter description: Specifies whether to enable the global system cache function.

Parameter type: Boolean

Unit: none

Value range:

  • on indicates that the global system cache function is enabled.
  • off indicates that the global system cache function is disabled.

Default value: on

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

Setting suggestion: Enable this function to reduce the memory usage of the system cache and improve the concurrent expansion capability. You are advised to use this parameter together with the thread pool parameter. After this parameter is enabled, you are advised to set wal_level of the standby node to hot_standby or higher if you need to access the standby node.

global_syscache_threshold

Parameter description: Specifies the maximum memory usage of the global system cache. To use this parameter, you need to enable the enable_global_syscache parameter.

Parameter type: integer

Unit: KB

Value range: 16384 to 1073741824

Default value: 163840

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

Setting suggestion: The smaller value of the number of hot databases and the number of threads x Memory size allocated to each database, that is, global_syscache_threshold = min(count(hot dbs),count(threads)) x memofdb.

The number of hot databases refers to the number of frequently accessed databases. In thread pool mode, the number of threads is the sum of the number of threads in the thread pool and the number of background threads. In non-thread pool mode, the number of hot databases is used.

memofdb indicates the average memory allocated to each database. The background noise memory of each database is 2 MB. Each time a table or index is added, 11 KB memory is added.

If this parameter is set to a small value, memory is frequently evicted, and a large number of memory fragments cannot be recycled. As a result, memory control fails.