简体   繁体   中英

Why the amount of WAL files decrease

I monitor the amount of WAL files in pg_wal . Overtimes, it reduces by itself. I dont have clustering, just single server with logical replication.

My parameter:

archive_timeout = 3600
min_wal_size = 2 GB
max_wal_size = 16 GB
wal_keep_segment = 4000
archiving_mode = ON
archive command = test ! -f /archive/%f && cp %p /archive/%f
wal_level = logical

What are the reasons the amount of WALs reduce? I try to look for articles but never found one. Please point me to one or maybe answer this.

Thanks

WAL segments are automatically deleted if they are no longer needed. Also, PostgreSQL automatically creates new WAL segments for future use, and the number of such segments depends on the amount of data modification activity. So it is totally normal for the size of pg_wal to vary with the amount of data modification activity.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM