HomeMogDBMogDB StackUqbar
v2.0

Documentation:v2.0

Supported Versions:

Other Versions:

Recommended Value of GUC Parameters

When PTK installs MogDB, it will automatically optimize and modify the database parameter values according to the server's configuration by default. The specific parameters that will be modified vary from version to version, and you can check them with this command:

# Replace MogDB-VERSION with the specific MogDB version number
ptk rec-guc <MogDB-VERSION>

# You can also compare the differences by specifying two version numbers at the same time (up to two version numbers are supported at the same time)
ptk rec-guc <VERSION1> <VERSION2>

If you do not want PTK to optimize parameter values, you can specify the --default-guc option when installing the database cluster. With this option specified, PTK maintains the database defaults for all parameters during installation, except for configuring the Required Parameters.

Notes

  1. PTK optimizes parameter values for MogDB and Uqbar databases only, other databases of the same type are installed with default parameter values.
  2. If a parameter with the same name as the Optimized Parameters is configured in the db_conf section of the configuration file, the parameter configured in db_conf will take effect.
  3. When deploying a database with less than 4G server memory, all Optimized Parameters will maintain the database defaults.

Required Parameters

When there is only one database instance in the deployed cluster, PTK enables maximum available mode by adding most_available_sync=on to the required parameters.

parameter value
local_bind_address The host field in the db_servers section of the PTK configuration file
port The db_port field in the db_servers section of the PTK configuration file
application_name The node name assigned to the instance by PTK, e.g. db_6001
available_zone The az_name field in the db_servers section of the PTK configuration file
unix_socket_directory The tmp_dir field in the PTK configuration file
unix_socket_permissions 0700
log_file_mode 0600
ssl off
ssl_cert_file server.crt
ssl_key_file server.key
ssl_ca_file cacert.pem
log_directory pg_log/$application_name of $log_dir in the PTK configuration file
audit_directory pg_audit/$application_name of $log_dir in the PTK configuration file
listen_addresses *
max_wal_senders 16

Optimized Parameters

  • When 4 < N <= 8
parameter value
max_connections 500
max_prepared_transactions 500
max_process_memory (0.6*N)GB
shared_buffers (0.2*N)GB
work_mem 16MB
maintenance_work_mem 512MB
wal_buffers 128MB
  • When 8 < N <= 64
parameter value
max_connections 1000
max_prepared_transactions 1000
max_process_memory (0.7*N)GB
shared_buffers (0.2*N)GB
work_mem 32MB
maintenance_work_mem 1GB
wal_buffers 512MB
  • When N > 64
parameter value
max_connections 3000
max_prepared_transactions 3000
max_process_memory (0.8*N)GB
shared_buffers (0.3*N)GB
work_mem 64MB
maintenance_work_mem 2GB
wal_buffers 1GB

Parameters that will be optimized by default

parameter value
remote_read_mode non_authentication
password_encryption_type 1
password_reuse_time 0
password_lock_time 0
password_effect_time 0
session_timeout 0
modify_initial_password off
wal_level logical
full_page_writes off
wal_log_hints off
xloginsert_locks 48
advance_xlog_file_num 10
wal_keep_segments 1024
most_available_sync on
catchup2normal_wait_time 0
enable_slot_log on
max_replication_slots 32
wal_receiver_timeout 10s
sync_config_strategy none_node
log_line_prefix '%m %u %d %r %p %S'
log_checkpoints on
vacuum_cost_limit 1000
autovacuum_max_workers 10
autovacuum_naptime 20s
autovacuum_vacuum_cost_delay 10
autovacuum_vacuum_scale_factor 0.05
autovacuum_analyze_scale_factor 0.02
autovacuum_vacuum_threshold 200
autovacuum_analyze_threshold 200
autovacuum_io_limits 104857600
instr_unique_sql_count 200000
enable_wdr_snapshot on
log_min_duration_statement 200
track_activity_query_size 2048
enable_instr_rt_percentile off
cstore_buffers 16MB
local_syscache_threshold 32MB
standby_shared_buffers_fraction 1
checkpoint_segments 1024
checkpoint_completion_target 0.8
max_files_per_process 100000
behavior_compat_options display_leading_zero
lc_messages en_US.UTF-8
lc_monetary en_US.UTF-8
lc_numeric en_US.UTF-8
lc_time en_US.UTF-8
enable_opfusion off
Copyright © 2011-2024 www.enmotech.com All rights reserved.