首页 > 代码库 > PostgreSQL9.6 服务器参数配置

PostgreSQL9.6 服务器参数配置

# - Connection Settings -

listen_addresses = ‘*‘

max_connections = 300 


# - TCP Keepalives -

tcp_keepalives_idle = 60

tcp_keepalives_interval = 10

tcp_keepalives_count = 6


# - Memory -

shared_buffers = 1GB

#shared_buffers=32GB(25 percent phisycal memory);

work_mem = 64MB

maintenance_work_mem = 512MB

dynamic_shared_memory_type = posix



# - Asynchronous Behavior -

max_worker_processes = 100              # (change requires restart)

max_parallel_workers_per_gather = 3     # taken from max_worker_processes


# - Checkpoints -

checkpoint_timeout=30min

max_wal_size = 10GB

min_wal_size = 5GB

  

# - Planner Cost Constants -

#parallel_tuple_cost = 0.1# same scale as above

#parallel_setup_cost = 1000.0# same scale as above

#min_parallel_relation_size = 8MB


# - Other Planner Options -

#force_parallel_mode = off


# - log setting -

log_destination = ‘stderr‘ 

logging_collector = on        

log_directory = ‘pg_log‘   

log_filename = ‘postgresql-%a.log‘

log_file_mode = 0600                 

log_truncate_on_rotation = on          

log_rotation_age = 1d                  

log_rotation_size = 0     

log_statement =  ‘none‘ 

log_line_prefix =‘%t [%p]: [%l-1] user=%u,db=%d ‘

log_timezone = ‘PRC‘

log_checkpoints = on

log_connections = on

log_disconnections = on

log_duration = on

log_lock_waits = on

log_temp_files = 0

log_min_duration_statement = 1000

track_activity_query_size = 2048


本文出自 “yiyi” 博客,请务必保留此出处http://heyiyi.blog.51cto.com/205455/1872704

PostgreSQL9.6 服务器参数配置