Re: autovac hitting too many tables at once

From: "Kevin Grittner" <Kevin(dot)Grittner(at)wicourts(dot)gov>
To: "pgsql-admin(at)postgresql(dot)org" <pgsql-admin(at)postgresql(dot)org>, "Greg Williamson" <gwilliamson39(at)yahoo(dot)com>
Subject: Re: autovac hitting too many tables at once
Date: 2012-06-22 19:13:56
Message-ID: 4FE47DA402000025000489E3@gw.wicourts.gov
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Greg Williamson <gwilliamson39(at)yahoo(dot)com> wrote:

> I've got an 8.4.11 system that I am relatively new to and I am
> seeing multiple autovac processes kick off on several of the
> largest tables at once and it is causing pain.
>
> Are there any suggestions to
>
> a) quickly relieve the immediate pain

Set autovacuum_cost_limit to a smaller value. (Change the
postgresql.conf file and do a reload.) I would start by cutting the
current value in half.

> and
>
> b) prevent such issues in the future (other than going to manual
> vacuuming on a schedule).

If it is suddenly doing this on lots of big tables at once, it seems
somewhat likely that you've hit the transaction wraparound
protection threshold. Because the vacuum necessary for this can be
painful, and they tend to come at the worst possible time (the more
your workload looks like a really heavy OLTP workload at any given
moment, the higher the probability that this is about to happen), I
always follow a bulk load (like from restoring pg_dump output) with
a VACUUM FREEZE ANALYZE.

You might also want to consider running off-hours vacuums to
supplement autovacuum. Upgrading to a more recent version of
PostgreSQL is likely to help some, too.

-Kevin

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Greg Williamson 2012-06-22 19:41:29 Re: autovac hitting too many tables at once
Previous Message Greg Williamson 2012-06-22 18:58:19 autovac hitting too many tables at once