Skip site navigation (1) Skip section navigation (2)

Re: Should autovacuum do a database wide vacuum near transaction limit?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "John Lister" <john(dot)lister-ps(at)kickstone(dot)com>
Cc: pgsql-admin(at)postgresql(dot)org
Subject: Re: Should autovacuum do a database wide vacuum near transaction limit?
Date: 2011-01-21 23:04:06
Message-ID: 1427.1295651046@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-admin
"John Lister" <john(dot)lister-ps(at)kickstone(dot)com> writes:
> Hi,  I'm running 8.3.9 on ubuntu with autovacuum enabled and seemingly working properly., however I've started getting messages saying that I'm near the transaction limit and I need to do a database wide vacuum, which I've started.
> From reading the docs, though I thought that autovacuum would do this on my behalf, is this true?

It's supposed to.  Did you look around to see if AV was trying to do
anything?

It's possible you got bit by this recently-fixed bug, which caused any
large-scale autovacuum operation to take unreasonably long to complete:

Author: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Branch: master [b58c25055] 2010-11-19 22:28:20 -0500
Branch: REL9_0_STABLE Release: REL9_0_2 [b5efc0940] 2010-11-19 22:28:25 -0500
Branch: REL8_4_STABLE Release: REL8_4_6 [fab2af30d] 2010-11-19 22:28:30 -0500
Branch: REL8_3_STABLE Release: REL8_3_13 [6cb9d5113] 2010-11-19 22:28:35 -0500

    Fix leakage of cost_limit when multiple autovacuum workers are active.
    
    When using default autovacuum_vac_cost_limit, autovac_balance_cost relied
    on VacuumCostLimit to contain the correct global value ... but after the
    first time through in a particular worker process, it didn't, because we'd
    trashed it in previous iterations.  Depending on the state of other autovac
    workers, this could result in a steady reduction of the effective
    cost_limit setting as a particular worker processed more and more tables,
    causing it to go slower and slower.  Spotted by Simon Poole (bug #5759).
    Fix by saving and restoring the GUC variables in the loop in do_autovacuum.
    
    In passing, improve a few comments.
    
    Back-patch to 8.3 ... the cost rebalancing code has been buggy since it was
    put in.

			regards, tom lane

In response to

Responses

pgsql-admin by date

Next:From: John ListerDate: 2011-01-21 23:33:36
Subject: Re: Should autovacuum do a database wide vacuum near transaction limit?
Previous:From: Tom LaneDate: 2011-01-21 22:03:41
Subject: Re: postgresql question

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group