forked from zkorum/agora
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpostgresql-monitoring.conf
More file actions
40 lines (33 loc) · 2.31 KB
/
Copy pathpostgresql-monitoring.conf
File metadata and controls
40 lines (33 loc) · 2.31 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
# PostgreSQL configuration for load testing monitoring
# This file is mounted into the postgres container to enable monitoring features
# Network configuration
listen_addresses = '*' # Listen on all interfaces for container networking
# Load pg_stat_statements extension for query performance tracking
shared_preload_libraries = 'pg_stat_statements'
# pg_stat_statements configuration
pg_stat_statements.max = 10000 # Track up to 10,000 distinct queries
pg_stat_statements.track = all # Track all statements (top-level + nested)
pg_stat_statements.track_utility = on # Track utility commands (CREATE, DROP, etc.)
pg_stat_statements.save = on # Persist stats across restarts
# Logging configuration for load testing
logging_collector = on # Enable log collection
log_directory = 'log' # Directory for log files (relative to PGDATA)
log_filename = 'postgresql-%Y-%m-%d_%H%M%S.log' # Log file naming pattern
log_rotation_age = 1d # Rotate logs daily
log_rotation_size = 100MB # Rotate when file reaches 100MB
# What to log
log_min_duration_statement = 10 # Log queries taking > 10ms (for detailed analysis)
log_line_prefix = '%t [%p]: user=%u,db=%d,app=%a ' # Detailed prefix with timestamp
log_statement = 'all' # Log all statements (SELECT, INSERT, UPDATE, DELETE) - useful for debugging read queries
log_connections = on # Log connection attempts
log_disconnections = on # Log session terminations
log_lock_waits = on # Log long lock waits (CRITICAL for contention!)
log_temp_files = 0 # Log all temporary file usage
# Error logging
log_error_verbosity = default # Include DETAIL, HINT, QUERY error information
# Replication settings
wal_level = replica # Enable WAL archiving for replication
max_wal_senders = 3 # Allow up to 3 concurrent replication connections
wal_keep_size = 1GB # Keep at least 1GB of WAL files for replicas
max_replication_slots = 3 # Allow up to 3 replication slots
hot_standby = on # Enable read queries on standby servers