# PostgreSQL Configuration for Production # Optimized for 2GB memory allocation # Connection Settings listen_addresses = '*' max_connections = 100 superuser_reserved_connections = 3 # Memory Settings (for 2GB allocation) shared_buffers = 512MB effective_cache_size = 1536MB maintenance_work_mem = 128MB work_mem = 5MB # Checkpoint Settings checkpoint_completion_target = 0.9 wal_buffers = 16MB default_statistics_target = 100 # Query Planner random_page_cost = 1.1 effective_io_concurrency = 200 # Write-Ahead Logging wal_level = replica max_wal_size = 2GB min_wal_size = 1GB # Logging log_destination = 'stderr' logging_collector = on log_directory = 'log' log_filename = 'postgresql-%Y-%m-%d_%H%M%S.log' log_rotation_age = 1d log_rotation_size = 100MB log_line_prefix = '%m [%p] %u@%d ' log_timezone = 'Europe/Berlin' # What to Log log_min_duration_statement = 1000 log_checkpoints = on log_connections = on log_disconnections = on log_lock_waits = on log_statement = 'ddl' # Autovacuum autovacuum = on autovacuum_max_workers = 3 autovacuum_naptime = 1min # Client Connection Defaults datestyle = 'iso, mdy' timezone = 'Europe/Berlin' 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 # Statement Timeout (prevent long-running queries) statement_timeout = 30000 # 30 seconds # Parallel Query Execution max_parallel_workers_per_gather = 2 max_parallel_workers = 4 max_worker_processes = 4