PostgreSQL Configuration
约 1 分钟阅读
Tools
- PGTune - Calculate optimal config based on hardware.
Common Settings (postgresql.conf)
# Network
listen_addresses = '*'
max_connections = 100
# Memory
shared_buffers = 128MB # ~25% of RAM
dynamic_shared_memory_type = posix
# WAL
max_wal_size = 1GB
min_wal_size = 80MB
# Locale & Time
log_timezone = 'UTC'
timezone = 'UTC'
datestyle = 'iso, mdy'
lc_messages = 'en_US.utf8'
default_text_search_config = 'pg_catalog.english'Logging Configuration
# Rotation
log_truncate_on_rotation = on
log_rotation_age = 1d
log_filename = 'postgresql-%a.log'
log_rotation_size = 0 # 0 to disable size-based rotationReferences
关联信息
反向链接、本文链接的其他页面和外部资料。
参考资料
GitHub1 条
- zalando/spilo/postgres-appliance/scripts/configure_spilo.pygithub.com/zalando/spilo/blob/master/postgres-appliance/scripts/configure_spilo.py
其他外链2 条
- pgtune.leopard.in.uapgtune.leopard.in.ua/
- www.postgresql.org/docs/current/logfile-maintenance.htmlwww.postgresql.org/docs/current/logfile-maintenance.html