https://pgtune.leopard.in.ua
$ egrep ^[a-z] /etc/postgresql/9.1/main/postgresql.conf
data_directory = '/var/lib/postgresql/9.1/main'
hba_file = '/etc/postgresql/9.1/main/pg_hba.conf'
ident_file = '/etc/postgresql/9.1/main/pg_ident.conf'
external_pid_file = '/var/run/postgresql/9.1-main.pid'
listen_addresses = '*'
port = 5432
max_connections = 1000
superuser_reserved_connections = 10
unix_socket_directory = '/var/run/postgresql'
ssl = true
tcp_keepalives_idle = 600
tcp_keepalives_interval = 60
shared_buffers = 42GB
temp_buffers = 1024MB
work_mem = 20MB
maintenance_work_mem = 2048MB
max_files_per_process = 1000
shared_preload_libraries = 'pg_stat_statements'
effective_io_concurrency = 1
wal_level = hot_standby
fsync = on # turns forced synchronization on or off
synchronous_commit = on # synchronization level; on, off, or local
wal_sync_method = fsync
full_page_writes = on # recover from partial page writes
checkpoint_segments = 64
checkpoint_timeout = 20min
archive_mode = on # allows archiving to be done
archive_command = 'cp %p /tmp/archivelog/%f && echo %f >>/tmp/archivelog/archive.list'
max_wal_senders = 10
wal_keep_segments = 2048
hot_standby = on # "on" allows queries during recovery
max_standby_archive_delay = 1000s
max_standby_streaming_delay = 1000s
effective_cache_size = 12000MB
log_destination = 'csvlog'
logging_collector = on # Enable capturing of stderr and csvlog
log_directory = '/var/log/postgresql'
log_filename = 'postgresql-%Y-%m-%d.log'
log_file_mode = 0644
log_truncate_on_rotation = off
log_rotation_age = 1d
log_rotation_size = 0
client_min_messages = notice
log_min_messages = notice
log_min_error_statement = notice
log_min_duration_statement = 60000
log_checkpoints = on
log_duration = off
log_line_prefix = '%t '
log_lock_waits = on # log lock waits >= deadlock_timeout
log_statement = 'ddl'
autovacuum = on # Enable autovacuum subprocess? 'on'
autovacuum_max_workers = 3
statement_timeout = 14400000
datestyle = 'iso, ymd'
lc_messages = 'C'
lc_monetary = 'zh_CN.UTF-8'
lc_numeric = 'zh_CN.UTF-8'
lc_time = 'zh_CN.UTF-8'
default_text_search_config = 'pg_catalog.simple'
custom_variable_classes = 'pg_stat_statements'
pg_stat_statements.max = 1000
pg_stat_statements.track = all
track_activity_query_size = 2048