[check_postgres] a check for hitting autovacuum_max_freeze_age?

Robert Treat xzilla at users.sourceforge.net
Tue Jul 15 14:36:51 UTC 2008


I've been thinking about adding a check for autovacuum_max_freeze_age.  The 
problem scenario I want to avoid is this:  once your database passes  
autovacuum_max_freeze_age, it must then vacuum every table that has not been 
vacuumed within the system. while this isnt a problem for many systems, on 
systems where there are a large number of unvacuumed tables, this causes 
quite a bit of extra i/o (scan every table, write hint bits etc...) and can 
use additional disk space. 

 scenarios where you might have a large number of these tables are databases 
that use a lot of bulk inserts, or copies, where data may be loaded, and 
analyzed, but not vacuum since there arent row modifications. for example, 
all databases upgraded through dump/restore fall into this category initially 
(until data changes would force vacuum on its own).  

the one thing i am thinking about is, is it enough to just compare the age of 
each database to max_freeze_age, and toss a warning if you get within say 10% 
of it.  or would it be better to make a smart check that would count the 
number of tables this would affect, and return a warning/critical based on 
the number of tables.  if we went that route, youd need to run the check once 
for each database, is that a problem? 

-- 
Robert Treat
Build A Brighter LAMP :: Linux Apache {middleware} PostgreSQL


More information about the Check_postgres mailing list