76 lines
1.8 KiB
Plaintext
76 lines
1.8 KiB
Plaintext
# PostgreSQL Production Configuration File
|
|
|
|
# CONNECTIONS AND AUTHENTICATION
|
|
listen_addresses = '*'
|
|
max_connections = 200
|
|
password_encryption = scram-sha-256
|
|
ssl = on
|
|
ssl_cert_file = '/etc/ssl/certs/ssl-cert-snakeoil.pem'
|
|
ssl_key_file = '/etc/ssl/private/ssl-cert-snakeoil.key'
|
|
|
|
# RESOURCE USAGE
|
|
shared_buffers = 2GB
|
|
work_mem = 8MB
|
|
maintenance_work_mem = 256MB
|
|
effective_cache_size = 8GB
|
|
max_worker_processes = 12
|
|
max_parallel_workers_per_gather = 4
|
|
max_parallel_workers = 12
|
|
|
|
# WRITE-AHEAD LOG
|
|
wal_level = replica
|
|
max_wal_size = 2GB
|
|
min_wal_size = 1GB
|
|
checkpoint_timeout = 15min
|
|
checkpoint_completion_target = 0.9
|
|
archive_mode = on
|
|
archive_command = 'test ! -f /var/lib/postgresql/archive/%f && cp %p /var/lib/postgresql/archive/%f'
|
|
|
|
# REPLICATION
|
|
max_wal_senders = 10
|
|
wal_keep_size = 1GB
|
|
hot_standby = on
|
|
hot_standby_feedback = on
|
|
|
|
# QUERY TUNING
|
|
random_page_cost = 1.1
|
|
effective_io_concurrency = 200
|
|
default_statistics_target = 500
|
|
jit = on
|
|
|
|
# LOGGING
|
|
log_destination = 'stderr'
|
|
logging_collector = on
|
|
log_directory = 'pg_log'
|
|
log_filename = 'postgresql-%Y-%m-%d_%H%M%S.log'
|
|
log_truncate_on_rotation = off
|
|
log_rotation_age = 1d
|
|
log_rotation_size = 100MB
|
|
log_min_duration_statement = 1000
|
|
log_checkpoints = on
|
|
log_connections = on
|
|
log_disconnections = on
|
|
log_duration = off
|
|
log_error_verbosity = default
|
|
log_line_prefix = '%m [%p] %q%u@%d '
|
|
log_statement = 'none'
|
|
|
|
# AUTOVACUUM
|
|
autovacuum = on
|
|
log_autovacuum_min_duration = 1000
|
|
autovacuum_max_workers = 6
|
|
autovacuum_naptime = 1min
|
|
autovacuum_vacuum_threshold = 50
|
|
autovacuum_analyze_threshold = 50
|
|
autovacuum_vacuum_scale_factor = 0.05
|
|
autovacuum_analyze_scale_factor = 0.025
|
|
|
|
# CLIENT CONNECTION DEFAULTS
|
|
datestyle = 'iso, mdy'
|
|
timezone = 'UTC'
|
|
lc_messages = 'en_US.UTF-8'
|
|
lc_monetary = 'en_US.UTF-8'
|
|
lc_numeric = 'en_US.UTF-8'
|
|
lc_time = 'en_US.UTF-8'
|
|
default_text_search_config = 'pg_catalog.english'
|