【PgSQL日常管理】postgresql.conf
参数文件:
default_transaction_isolation = 'read committed'
listen_addresses = '*'
port = 5432
max_connections = 2000
superuser_reserved_connections = 10
full_page_writes = on
wal_level = replica
wal_log_hints = off
max_wal_senders = 50
max_wal_size = 1GB
min_wal_size = 80MB
hot_standby = on
log_destination = 'csvlog'
logging_collector = on
log_directory = '/data/pgsql_5432/pg_log/'
#log_filename = 'postgresql-%Y-%m-%d_%H%M%S.log'
log_filename = 'postgresql-%w.log'
log_file_mode = 0640
log_truncate_on_rotation = on
log_rotation_age = 1d
#log_rotation_size = 10MB
log_statement = 'mod'
log_timezone = 'Asia/Shanghai'
timezone = 'Asia/Shanghai'
datestyle = 'iso, mdy'
unix_socket_directories = '/data/pgsql_5432'
temp_tablespaces = 'ts_temp_customer'
shared_buffers = 20480MB
temp_buffers = 16MB
work_mem = 128MB
effective_cache_size = 2GB
maintenance_work_mem = 512MB
#max_stack_depth = 2MB
dynamic_shared_memory_type = posix
#checkpoint_segments = 16
checkpoint_timeout = 30min
checkpoint_completion_target = 0.9
wal_buffers = 16MB
wal_writer_delay = 200ms
synchronous_commit = remote_write
commit_delay = 0
commit_siblings = 5
archive_mode = on
archive_command = 'cp %p /data/pgsql_5432/pg_arch/%f && echo %f >> /data/pgsql_5432/pg_arch/archive.list'
wal_keep_segments=1024
synchronous_standby_names = 'FIRST 1(*)'
log_min_duration_statement = 0
log_checkpoints = on
log_connections = on
log_disconnections = on
log_lock_waits = on
log_temp_files = 0
log_autovacuum_min_duration = 0
log_error_verbosity = default
archive_timeout = 60s
deadlock_timeout = 3s
log_duration = on
log_line_prefix = '%t [%p]: [%l-1] user=%u,db=%d'
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· SQL Server 2025 AI相关能力初探
· Linux系列:如何用 C#调用 C方法造成内存泄露
· AI与.NET技术实操系列(二):开始使用ML.NET
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
· 阿里最新开源QwQ-32B,效果媲美deepseek-r1满血版,部署成本又又又降低了!
· SQL Server 2025 AI相关能力初探
· AI编程工具终极对决:字节Trae VS Cursor,谁才是开发者新宠?
· 开源Multi-agent AI智能体框架aevatar.ai,欢迎大家贡献代码
· Manus重磅发布:全球首款通用AI代理技术深度解析与实战指南