-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpostgresql.conf
More file actions
77 lines (67 loc) · 1.9 KB
/
Copy pathpostgresql.conf
File metadata and controls
77 lines (67 loc) · 1.9 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
# PostgreSQL Configuration for NVIAS Voting System
# Optimized for reliability and data protection
# CONNECTIONS AND AUTHENTICATION
listen_addresses = '*'
port = 5432
max_connections = 100
shared_preload_libraries = 'pg_stat_statements'
# MEMORY SETTINGS
shared_buffers = 128MB
effective_cache_size = 256MB
maintenance_work_mem = 32MB
work_mem = 4MB
# WRITE AHEAD LOG (WAL) - Critical for data protection
wal_level = replica
wal_buffers = 16MB
max_wal_size = 1GB
min_wal_size = 80MB
wal_keep_segments = 32
checkpoint_completion_target = 0.7
checkpoint_timeout = 5min
# ARCHIVING - Enable for backup protection
archive_mode = on
archive_command = 'cp %p /backups/wal_archive/%f'
archive_timeout = 300s
# QUERY TUNING
random_page_cost = 1.1
effective_io_concurrency = 2
default_statistics_target = 100
# ERROR REPORTING AND 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 = on
log_rotation_age = 1d
log_rotation_size = 100MB
log_line_prefix = '%t [%p]: [%l-1] user=%u,db=%d,app=%a,client=%h '
log_checkpoints = on
log_connections = on
log_disconnections = on
log_lock_waits = on
log_temp_files = 10MB
log_autovacuum_min_duration = 0
log_error_verbosity = default
log_statement = 'ddl'
log_min_duration_statement = 1000
# AUTOVACUUM - Important for performance
autovacuum = on
autovacuum_max_workers = 3
autovacuum_naptime = 60s
autovacuum_vacuum_threshold = 50
autovacuum_analyze_threshold = 50
autovacuum_vacuum_scale_factor = 0.1
autovacuum_analyze_scale_factor = 0.05
# CLIENT CONNECTION DEFAULTS
timezone = 'UTC'
datestyle = 'iso, mdy'
lc_messages = 'en_US.utf8'
lc_monetary = 'en_US.utf8'
lc_numeric = 'en_US.utf8'
lc_time = 'en_US.utf8'
default_text_search_config = 'pg_catalog.english'
# LOCK MANAGEMENT
deadlock_timeout = 1s
max_locks_per_transaction = 64
# DATA CHECKSUMS AND CORRUPTION PROTECTION
data_checksums = on