postgresql 9.1 的一些参数

https://pgtune.leopard.in.ua

$ egrep ^[a-z] /etc/postgresql/9.1/main/postgresql.conf 
data_directory = '/var/lib/postgresql/9.1/main'     # use data in another directory
hba_file = '/etc/postgresql/9.1/main/pg_hba.conf'   # host-based authentication file
ident_file = '/etc/postgresql/9.1/main/pg_ident.conf'   # ident configuration file
external_pid_file = '/var/run/postgresql/9.1-main.pid'      # write an extra PID file

listen_addresses = '*'      # what IP address(es) to listen on;
port = 5432             # (change requires restart)
max_connections = 1000          # (change requires restart)
superuser_reserved_connections = 10 # (change requires restart)
unix_socket_directory = '/var/run/postgresql'       # (change requires restart)
ssl = true              # (change requires restart)
tcp_keepalives_idle = 600       # TCP_KEEPIDLE, in seconds;
tcp_keepalives_interval = 60        # TCP_KEEPINTVL, in seconds;

shared_buffers = 42GB           # min 128kB
temp_buffers = 1024MB           # min 800kB
work_mem = 20MB             # min 64kB
maintenance_work_mem = 2048MB       # min 1MB
max_files_per_process = 1000        # min 25

shared_preload_libraries = 'pg_stat_statements'     # (change requires restart)
effective_io_concurrency = 1        # 1-1000. 0 disables prefetching

wal_level = hot_standby         # minimal, archive, or hot_standby
fsync = on              # turns forced synchronization on or off
synchronous_commit = on                # synchronization level; on, off, or local
wal_sync_method = fsync         # the default is the first option
full_page_writes = on                   # recover from partial page writes
checkpoint_segments = 64        # in logfile segments, min 1, 16MB each
checkpoint_timeout = 20min      # range 30s-1h

archive_mode = on       # allows archiving to be done
archive_command = 'cp %p /tmp/archivelog/%f && echo %f >>/tmp/archivelog/archive.list'      # command to use to archive a logfile segment

max_wal_senders = 10        # max number of walsender processes
wal_keep_segments = 2048    # in logfile segments, 16MB each; 0 disables
hot_standby = on    # "on" allows queries during recovery
max_standby_archive_delay = 1000s   # max delay before canceling queries
max_standby_streaming_delay = 1000s # max delay before canceling queries
effective_cache_size = 12000MB

log_destination = 'csvlog'      # Valid values are combinations of
logging_collector = on      # Enable capturing of stderr and csvlog
log_directory = '/var/log/postgresql'   # directory where log files are written,
log_filename = 'postgresql-%Y-%m-%d.log'    # log file name pattern,
log_file_mode = 0644            # creation mode for log files,
log_truncate_on_rotation = off      # If on, an existing log file with the
log_rotation_age = 1d           # Automatic rotation of logfiles will
log_rotation_size = 0               # Automatic rotation of logfiles will
client_min_messages = notice        # values in order of decreasing detail:
log_min_messages = notice       # values in order of decreasing detail:
log_min_error_statement = notice        # values in order of decreasing detail:
log_min_duration_statement = 60000  # -1 is disabled, 0 logs all statements
log_checkpoints = on
log_duration = off
log_line_prefix = '%t '         # special values:
log_lock_waits = on         # log lock waits >= deadlock_timeout
log_statement = 'ddl'           # none, ddl, mod, all

autovacuum = on         # Enable autovacuum subprocess?  'on'
autovacuum_max_workers = 3      # max number of autovacuum subprocesses
statement_timeout = 14400000            # in milliseconds, 0 is disabled

datestyle = 'iso, ymd'
lc_messages = 'C'           # locale for system error message
lc_monetary = 'zh_CN.UTF-8'         # locale for monetary formatting
lc_numeric = 'zh_CN.UTF-8'          # locale for number formatting
lc_time = 'zh_CN.UTF-8'             # locale for time formatting

default_text_search_config = 'pg_catalog.simple'
custom_variable_classes = 'pg_stat_statements'      # list of custom variable class names
pg_stat_statements.max = 1000
pg_stat_statements.track = all
track_activity_query_size = 2048
原文地址:https://www.cnblogs.com/ctypyb2002/p/9793050.html