時間:2024-03-11 15:08作者:下載吧人氣:20
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
網友評論