【Manager Handbook for Distributed AntDB-T】Database Parameter Setting - Standalone Version
Standalone version
Execute on the database host by logging in to the database as a superuseruser via psql. After the execution is completed, a restart of the database is required.
--Modify according to actual situation/Users are requested to make appropriate adjustments based on host environment information
alter system set shared_buffers = '4GB' ;
alter system set maintenance_work_mem = '1024MB';
alter system set work_mem = '128MB' ;
alter system set max_connections = 1000 ;
alter system set max_prepared_transactions = 1000 ;
alter system set wal_keep_size = 51200 ;
alter system set effective_cache_size = '10GB' ;
alter system set max_parallel_workers = 10 ;
alter system set max_parallel_workers_per_gather = 10 ;
----
alter system set logging_collector = on;
alter system set log_destination = csvlog ;
alter system set log_directory = pg_log ;
alter system set log_truncate_on_rotation = on;
alter system set log_rotation_age = '7d' ;
alter system set log_rotation_size = '100MB' ;
alter system set log_min_messages = error;
alter system set log_min_error_statement = error ;
alter system set log_duration = off;
alter system set log_statement = 'ddl' ;
alter system set unix_socket_permissions = '0700' ;
alter system set listen_addresses = '*';
alter system set superuser_reserved_connections = 13 ;
alter system set track_counts = on ;
alter system set track_activity_query_size = 2048;
alter system set max_locks_per_transaction = 64;
alter system set constraint_exclusion = on ;
alter system set wal_level='replica';
alter system set max_wal_senders = 5 ;
alter system set wal_log_hints = on;
alter system set autovacuum = on ;
alter system set autovacuum_max_workers = 5;
alter system set autovacuum_naptime = '60min' ;
alter system set autovacuum_vacuum_threshold = 500 ;
alter system set autovacuum_analyze_threshold = 500;
alter system set autovacuum_vacuum_scale_factor = 0.5;
alter system set autovacuum_vacuum_cost_limit = -1 ;
alter system set autovacuum_vacuum_cost_delay = '30ms' ;
alter system set statement_timeout = 0 ;
alter system set lock_timeout = '180s' ;
alter system set wal_sync_method = open_datasync ;
alter system set wal_writer_delay = '200ms';
alter system set commit_delay = 10 ;
alter system set commit_siblings = 10;
alter system set checkpoint_timeout = '15min' ;
alter system set checkpoint_completion_target = 0.9;
alter system set max_wal_size = 10240;
alter system set archive_mode = on ;
alter system set archive_command = '/bin/date' ;
alter system set bgwriter_delay = '10ms' ;
alter system set bgwriter_lru_maxpages = 1000;
alter system set bgwriter_lru_multiplier = 10.0;