postgresql 10.3 的一些参数

https://pgtune.leopard.in.ua

 alter system set listen_addresses = '*';
 alter system set port = 5432;
 alter system set max_connections = 1000;

 alter system set tcp_keepalives_idle = 60;
 alter system set tcp_keepalives_interval = 10;
 alter system set tcp_keepalives_count = 10;

 alter system set shared_buffers = '4GB';
 alter system set huge_pages = 'try';
 alter system set temp_buffers = '32MB';
 alter system set work_mem = '20MB';
 alter system set maintenance_work_mem = '1GB';
 alter system set dynamic_shared_memory_type = 'posix';
 alter system set max_files_per_process = 2000;
 alter system set shared_preload_libraries = 'pg_stat_statements';

 alter system set force_parallel_mode = 'on';
 alter system set max_worker_processes = 8;
 alter system set max_parallel_workers_per_gather = 4;
 alter system set max_parallel_workers = 8;

 alter system set wal_level = replica;
 alter system set fsync = on;
 alter system set synchronous_commit = on;
 alter system set wal_sync_method = fdatasync;
 alter system set full_page_writes = on;
 alter system set wal_buffers = '32MB';
 alter system set wal_compression = on;
 alter system set wal_log_hints = on;
 alter system set checkpoint_timeout = '60min';
 alter system set max_wal_size = '10GB';
 alter system set max_wal_senders = 10;
 alter system set wal_keep_segments = 2000;
 alter system set effective_cache_size = '32GB';
 alter system set hot_standby = on;

 alter system set log_destination = 'csvlog';
 alter system set logging_collector = on;
 alter system set log_directory = '/var/log/postgresql';
 alter system set log_filename = 'postgresql-%Y-%m-%d.log';
 alter system set log_file_mode = '0644';
 alter system set log_truncate_on_rotation = off;
 alter system set log_rotation_age = '1d';
 alter system set log_rotation_size = '0';
 alter system set client_min_messages = 'notice';
 alter system set log_min_messages = 'notice';
 alter system set log_min_error_statement = 'notice';
 alter system set log_min_duration_statement = '60000';
 alter system set log_checkpoints = on;
 alter system set log_connections = on;
 alter system set log_disconnections = on;
 alter system set log_error_verbosity = 'verbose'; 
 alter system set log_duration = off;
 alter system set log_line_prefix = '%t ';
 alter system set log_lock_waits = on;

 alter system set autovacuum = 'on';
 alter system set autovacuum_max_workers = 3;
 alter system set statement_timeout = 144000000;
 alter system set timezone = 'PRC';
 alter system set datestyle = 'iso, ymd';
 alter system set lc_messages = 'C';
 alter system set track_activities = 'on';
 alter system set default_text_search_config = 'pg_catalog.english';
posted @ 2018-04-24 16:43  peiybpeiyb  阅读(694)  评论(0编辑  收藏  举报