[check_postgres] check_postgres_last_autovacuum

Robert Treat xzilla at users.sourceforge.net
Tue Jul 15 14:24:20 UTC 2008


On Monday 14 July 2008 21:14:33 Greg Sabino Mullane wrote:
> > I have autovacuum turned on but I get this:
> >
> > POSTGRES_LAST_AUTOVACUUM CRITICAL: DB "dbname" (host:192.168.144.103)
> > public.people_profile: 11:41 June 04, 2008 (3105742 s) | time=0.04
> > public.people_profile=3105742 public.snapboard_category=3104961
>
> ....
>
> > public.crime_arrest_charges=18 public.auth_user=18
> >
> > I believe tables that never change (no inserts, deletes, or updates) will
> > never get autovaccuumed since there is no need.  So is this what is
> > happening?  Will this be reported as a warning or critical even if that
> > table didn¹t need to be vacuumed?
>
> Upon re-reading this, the answer is yes to both questions. The script can
> only know when the last time something was autovacuumed, it has no way of
> knowing about why autovacuum may or may not have skipped vacuuming a
> each table the last time it ran. In the example above, you would need
> to either explicitly include the tables you want to check, or include the
> ones you do. You've got a wide range: the people_profile has not been
> autovaced in over a month, while auth_user was vacuumed 18 seconds ago.
>
> If you would like the action to do something different, just describe
> exactly what you want it to do and we can see about coming up with a new
> action, but this is what this one is designed to do, I'm afraid. We could
> perhaps come up with an action that asks what the latest time *any*
> autovacuum run is (which I think is what Robert's ORDER BY 3 DESC was
> alluding to), but I'm not sure I see the usefulness of that, other than a
> crude measure of if autovacuum is running or not, of which there may be
> better ways to check.

For example, rather than measuring if autovacuum is running, it's probably 
better to measure table bloat.   

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


More information about the Check_postgres mailing list