- Add comprehensive health check system with multiple endpoints - Add Prometheus metrics endpoint - Add production logging configurations (5 strategies) - Add complete deployment documentation suite: * QUICKSTART.md - 30-minute deployment guide * DEPLOYMENT_CHECKLIST.md - Printable verification checklist * DEPLOYMENT_WORKFLOW.md - Complete deployment lifecycle * PRODUCTION_DEPLOYMENT.md - Comprehensive technical reference * production-logging.md - Logging configuration guide * ANSIBLE_DEPLOYMENT.md - Infrastructure as Code automation * README.md - Navigation hub * DEPLOYMENT_SUMMARY.md - Executive summary - Add deployment scripts and automation - Add DEPLOYMENT_PLAN.md - Concrete plan for immediate deployment - Update README with production-ready features All production infrastructure is now complete and ready for deployment.
87 lines
2.5 KiB
Plaintext
87 lines
2.5 KiB
Plaintext
# PostgreSQL Configuration for Custom PHP Framework
|
|
# Optimized for development with production-ready defaults
|
|
|
|
# ==========================================
|
|
# Connection Settings
|
|
# ==========================================
|
|
listen_addresses = '*'
|
|
max_connections = 100
|
|
superuser_reserved_connections = 3
|
|
|
|
# ==========================================
|
|
# Memory Settings
|
|
# ==========================================
|
|
# Adjust based on available RAM (docker-compose limits: 1GB)
|
|
shared_buffers = 256MB
|
|
effective_cache_size = 768MB
|
|
maintenance_work_mem = 64MB
|
|
work_mem = 4MB
|
|
|
|
# ==========================================
|
|
# Query Tuning
|
|
# ==========================================
|
|
random_page_cost = 1.1 # Optimized for SSD
|
|
effective_io_concurrency = 200
|
|
|
|
# ==========================================
|
|
# Write-Ahead Log (WAL)
|
|
# ==========================================
|
|
wal_buffers = 16MB
|
|
min_wal_size = 1GB
|
|
max_wal_size = 4GB
|
|
checkpoint_completion_target = 0.9
|
|
|
|
# ==========================================
|
|
# Logging
|
|
# ==========================================
|
|
logging_collector = on
|
|
log_directory = 'pg_log'
|
|
log_filename = 'postgresql-%Y-%m-%d_%H%M%S.log'
|
|
log_min_duration_statement = 200 # Log slow queries (>200ms)
|
|
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 = 0
|
|
log_autovacuum_min_duration = 0
|
|
|
|
# ==========================================
|
|
# Performance Monitoring
|
|
# ==========================================
|
|
shared_preload_libraries = 'pg_stat_statements'
|
|
pg_stat_statements.track = all
|
|
pg_stat_statements.max = 10000
|
|
|
|
# ==========================================
|
|
# Autovacuum
|
|
# ==========================================
|
|
autovacuum = on
|
|
autovacuum_max_workers = 3
|
|
autovacuum_naptime = 1min
|
|
|
|
# ==========================================
|
|
# Locale & Formatting
|
|
# ==========================================
|
|
timezone = 'UTC'
|
|
lc_messages = 'C'
|
|
lc_monetary = 'C'
|
|
lc_numeric = 'C'
|
|
lc_time = 'C'
|
|
default_text_search_config = 'pg_catalog.english'
|
|
|
|
# ==========================================
|
|
# Connection Pooling (Framework-friendly)
|
|
# ==========================================
|
|
# Connection lifecycle matching framework patterns
|
|
tcp_keepalives_idle = 60
|
|
tcp_keepalives_interval = 10
|
|
tcp_keepalives_count = 5
|
|
|
|
# ==========================================
|
|
# Security (Development Defaults)
|
|
# ==========================================
|
|
# In production, use SSL and stricter settings
|
|
ssl = off
|
|
password_encryption = scram-sha-256
|