From 890bfe1e9522f52b44d495543c7181265295aaf0 Mon Sep 17 00:00:00 2001 From: Zev Benjamin Date: Wed, 16 Oct 2013 16:31:42 -0400 Subject: [PATCH] puppet: Up the Postgres autovacuum_freeze_max_age and related parameters These parameters collectively determine when very old transaction ids are replaced with the special FrozenXID transaction id, which is older than any other transaction id. Old transaction ids must be periodically replaced like this to prevent transaction id wraparound. The only disadvantage of increasing autovacuum_freeze_max_age is increased disk usage, but a value of 2 billion should only require 500MB, which is pretty trivial. Since changing autovacuum_freeze_max_age requires a restart, we will still have to issue a manual VACUUM, with vacuum_freeze_min_age and vacuum_freeze_table_age temporarily set to lower values. (imported from commit 22f9ecdfc5b6a07918771d541192aa6d6369878a) --- .../modules/zulip/files/postgresql/postgresql.conf.master | 4 ++++ .../modules/zulip/files/postgresql/postgresql.conf.slave | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/servers/puppet/modules/zulip/files/postgresql/postgresql.conf.master b/servers/puppet/modules/zulip/files/postgresql/postgresql.conf.master index 1a925d8071..21222e0bb6 100644 --- a/servers/puppet/modules/zulip/files/postgresql/postgresql.conf.master +++ b/servers/puppet/modules/zulip/files/postgresql/postgresql.conf.master @@ -586,6 +586,10 @@ log_lock_waits = on log_temp_files = 0 log_autovacuum_min_duration = 100 +autovacuum_freeze_max_age = 2000000000 +vacuum_freeze_min_age = 1000000000 +vacuum_freeze_table_age = 1800000000 + # Master replication settings (ignored on standby) wal_level = hot_standby max_wal_senders = 5 diff --git a/servers/puppet/modules/zulip/files/postgresql/postgresql.conf.slave b/servers/puppet/modules/zulip/files/postgresql/postgresql.conf.slave index 354a6abf51..928c770701 100644 --- a/servers/puppet/modules/zulip/files/postgresql/postgresql.conf.slave +++ b/servers/puppet/modules/zulip/files/postgresql/postgresql.conf.slave @@ -582,6 +582,10 @@ log_lock_waits = on log_temp_files = 0 log_autovacuum_min_duration = 100 +autovacuum_freeze_max_age = 2000000000 +vacuum_freeze_min_age = 1000000000 +vacuum_freeze_table_age = 1800000000 + # Master replication settings (ignored on standby) wal_level = hot_standby max_wal_senders = 2