# CONNECTIONS AND AUTHENTICATION

listen_addresses = '*'                  # what IP address(es) to listen on;
max_connections = 80

tcp_keepalives_idle = 210
tcp_keepalives_interval = 60
tcp_keepalives_count = 5

# RESOURCE USAGE (except WAL)

shared_buffers = 18GB                     # min 128kB
temp_buffers = 20MB                     # min 800kB
work_mem = 40MB                           # min 64kB
maintenance_work_mem = 2GB            # min 1MBQ

# - Asynchronous Behavior -
effective_io_concurrency = 200
max_worker_processes = 8
max_parallel_workers_per_gather = 4
max_parallel_workers=8
max_parallel_maintenance_workers = 4

# WRITE AHEAD LOG

synchronous_commit = off                # synchronization level;
min_wal_size = 3GB
max_wal_size = 6GB
wal_buffers = 16MB
default_statistics_target = 200
checkpoint_completion_target = 0.9      # checkpoint target duration, 0.0 - 1.0

# QUERY TUNING

random_page_cost = 1.1
effective_cache_size = 30GB
geqo_effort = 9                         # range 1-10

# ERROR REPORTING AND LOGGING

log_line_prefix = '%m '                 # special values:
log_min_duration_statement = 10s
log_timezone = 'America/New_York'

# AUTOVACUUM PARAMETERS

autovacuum_max_workers = 5
autovacuum_naptime = 45s
autovacuum_vacuum_scale_factor = 0.16   # fraction of table size before vacuum
autovacuum_analyze_scale_factor = 0.08  # fraction of table size before analyze

# CLIENT CONNECTION

datestyle = 'iso, mdy'
timezone = 'America/New_York'

# RUNTIME STATISTICS

track_activity_query_size = 8192
