-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpostgresql.conf
More file actions
80 lines (71 loc) · 1.91 KB
/
postgresql.conf
File metadata and controls
80 lines (71 loc) · 1.91 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
# Basic PostgreSQL configuration for production
listen_addresses = '*'
max_connections = 300
tcp_keepalives_idle = 60
tcp_keepalives_interval = 10
tcp_keepalives_count = 6
# Memory Configuration
shared_buffers = '256MB'
effective_cache_size = '1GB'
maintenance_work_mem = '128MB'
work_mem = '16MB'
temp_buffers = '16MB'
# Write Ahead Log
wal_level = 'replica'
wal_buffers = '8MB'
min_wal_size = '1GB'
max_wal_size = '4GB'
checkpoint_timeout = '15min'
checkpoint_completion_target = 0.9
checkpoint_warning = '30s'
# Query Planner
random_page_cost = 1.1
effective_io_concurrency = 200
default_statistics_target = 100
# Parallel Query Settings
max_worker_processes = 8
max_parallel_workers_per_gather = 2
max_parallel_workers = 4
parallel_leader_participation = on
# Logging Configuration
log_destination = 'stderr'
logging_collector = on
log_directory = '/var/lib/postgresql/log'
log_filename = 'postgresql-%Y-%m-%d_%H%M%S.log'
log_rotation_age = 1d
log_rotation_size = '100MB'
log_min_duration_statement = 1000
log_checkpoints = on
log_connections = on
log_disconnections = on
log_lock_waits = on
log_temp_files = 0
log_autovacuum_min_duration = 250
log_line_prefix = '%m [%p] %q%u@%d '
# Autovacuum Settings
autovacuum = on
autovacuum_max_workers = 3
autovacuum_naptime = '1min'
autovacuum_vacuum_threshold = 50
autovacuum_analyze_threshold = 50
autovacuum_vacuum_scale_factor = 0.1
autovacuum_analyze_scale_factor = 0.05
# Statistics and Monitoring
shared_preload_libraries = 'pg_stat_statements'
pg_stat_statements.track = all
pg_stat_statements.max = 5000
track_activity_query_size = 2048
track_io_timing = on
# Security Settings
ssl = on
ssl_cert_file = '/etc/postgresql/ssl/fullchain.pem'
ssl_key_file = '/etc/postgresql/ssl/privkey.pem'
ssl_prefer_server_ciphers = on
password_encryption = scram-sha-256
# Locale and Timezone Settings
timezone = 'UTC'
datestyle = 'iso, mdy'
lc_messages = 'C'
lc_monetary = 'C'
lc_numeric = 'C'
lc_time = 'C'