Re: autovac hitting too many tables at once - Mailing list pgsql-admin

From Kevin Grittner
Subject Re: autovac hitting too many tables at once
Date
Msg-id 4FE47DA402000025000489E3@gw.wicourts.gov
Whole thread Raw
In response to autovac hitting too many tables at once  (Greg Williamson <gwilliamson39@yahoo.com>)
Responses Re: autovac hitting too many tables at once  (Greg Williamson <gwilliamson39@yahoo.com>)
List pgsql-admin
Greg Williamson <gwilliamson39@yahoo.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

pgsql-admin by date:

Previous
From: Greg Williamson
Date:
Subject: autovac hitting too many tables at once
Next
From: Greg Williamson
Date:
Subject: Re: autovac hitting too many tables at once