-
Notifications
You must be signed in to change notification settings - Fork 923
/
Copy pathpostgresql.conf
37 lines (32 loc) · 2.19 KB
/
postgresql.conf
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
# General Settings
listen_addresses = '*' # Listen on all interfaces
max_connections = 1024 # Maximum concurrent connections (adjust according to your system's capacity)
shared_buffers = 32MB # Amount of memory used for caching data (reduced to fit within memory constraint)
work_mem = 8MB # Amount of memory used for internal sort operations
maintenance_work_mem = 64MB # Amount of memory used for maintenance tasks like VACUUM, CREATE INDEX
# wal_level = minimal # Set WAL level to 'minimal' for reduced write overhead
wal_level = replica # Set WAL level to 'replica' for replication support
synchronous_commit = off # Asynchronous commit for better performance
checkpoint_timeout = 5min # Interval between automatic WAL checkpoints (reduced for more frequent checkpoints)
checkpoint_completion_target = 0.7 # Target duration for completing checkpoints
# Autovacuum Settings
autovacuum = on # Enable autovacuum
autovacuum_max_workers = 2 # Maximum number of autovacuum worker processes
autovacuum_naptime = 1min # Time between autovacuum runs
autovacuum_vacuum_scale_factor = 0.05 # Threshold to trigger a VACUUM
autovacuum_analyze_scale_factor = 0.02 # Threshold to trigger an ANALYZE
# Logging
# log_statement = 'all' # Log all SQL statements
# log_line_prefix = '%t [%p]: [%l-1] user=%u,db=%d,app=%a,client=%h ' # Customize log line format
# log_min_duration_statement = 200 # Log SQL statements longer than 200ms
# Logging
log_statement = 'none' # Disable logging of SQL statements to save resources
log_connections = off # Turn off logging of successful connections
log_disconnections = off # Turn off logging of disconnections
# Connection Settings
tcp_keepalives_idle = 60 # TCP keepalives idle time
tcp_keepalives_interval = 5 # TCP keepalives interval
tcp_keepalives_count = 5 # TCP keepalives count
# Other Settings
effective_cache_size = 100MB # Estimate of how much memory is available for caching data (reduced to fit within memory constraint)
random_page_cost = 2.0 # Relative cost of a non-sequentially fetched disk page compared to a page fetched sequentially