PostgreSQL version 10 WAL 設定概述
參數:
checkpoint_timeout
default is 5 minute
max_wal_size
default is 1GB
archive_timeout
full_page_writes
checkpoint_warning
checkpoint_completion_target
default is 0.5 and only be fraction of checkpoint_timeout
pg_test_fsync
can measure average speed in microsecond of single WAL flush operation. Half of its value is effective for reporting average time setting that it flush single 8KB write operation to commit_delay
. pg_test_fsync
doesn’t care whether fsync is turned off or not. Also its value is used to a start point for optimizing a particular workload.
wal_debug will
enforce to write XLOGFLUSH
and XLOGINSERTRECORD-related log into server log.
commit_delay
it purposes to amortize cost across concurrently commiting transactions. The higher the value, the more effective it’s expected to increasing throughput, to a point. Tuning commit_delay
is useful when WAL log is stored in high-rotational latency disk and even more effective to ssd or other RAID array with battery-back write cache. Higher value of commit_siblings
can be used to such cases. Oftenly, commit_siblings
use smaller value in high latency media. Remark: It’s quitely suffering when commit_delay
being set too high.
max_wal_size
Due to short-term peak of log output rate, if it exceeds max_wal_size
, the unneeded segment files will be removed until the system get back under the limit. When belowing the limit, the system recycle segment files for future estimated usage before next checkpoint and then the rest are removed.
min_wal_size
Reference: https://www.postgresql.org/docs/current/static/wal-configuration.html