软件下载吧文章资讯

分类分类

postgresql中wal_level的三个参数用法说明

2024-03-11 15:08作者:下载吧

wal_level中有三个主要的参数:minimal、archive和hot_standby

1、minimal是默认的值,它仅写入崩溃或者突发关机时所需要的信息(不建议使用)。

2、archive是增加wal归档所需的日志(最常用)。

3、hot_standby是在备用服务器上增加了运行只读查询所需的信息,一般实在流复制的时候使用到。

补充:postgresql WAL相关参数

配置文件

# – Settings –
wal_level = minimal # minimal, replica, orlogical
# (changerequires restart)
#fsync = on # flush data to disk for crash safety
# (turningthis off can cause
# unrecoverable datacorruption)
#synchronous_commit =on # synchronization level;
# off, local,remote_write, remote_apply
,or on
#wal_sync_method =fsync # the default is thefirst option
# supported by theoperating system:
# open_datasync
# fdatasync (default on Linux)
# fsync
# fsync_writethrough
# open_sync
full_page_writes =on # recover from partial page writes
#wal_compression =off # enable compression of full-pagewrites
#wal_log_hints =off # also do full pagewrites of non-critic
al updates
# (change requiresrestart)
#wal_buffers = -1 # min 32kB, -1 sets basedon shared_buffers
# (change requiresrestart)
#wal_writer_delay = 200ms # 1-10000 milliseconds
#wal_writer_flush_after= 1MB # 0 disables

#commit_delay = 0 # range 0-100000, inmicroseconds
#commit_siblings =5 # range 1-1000
# – Checkpoints –
#checkpoint_timeout =5min # range 30s-1d
#max_wal_size = 1GB
#min_wal_size = 80MB
#checkpoint_completion_target= 0.5 # checkpoint target duration,0.0 – 1.0
#checkpoint_flush_after= 0 # 0 disables #default is 256kB on linux, 0 otherwise
#checkpoint_warning =30s # 0 disables

展开全部

相关文章

说两句网友评论
    我要跟贴
    取消