Re: Autovacuum Tuning advice - Mailing list pgsql-performance

From Scott Marlowe
Subject Re: Autovacuum Tuning advice
Date
Msg-id dcc563d11002282258k2a7d55b1u8f111db99bf6f954@mail.gmail.com
Whole thread Raw
In response to Autovacuum Tuning advice  ("Plugge, Joe R." <JRPlugge@west.com>)
Responses Re: Autovacuum Tuning advice  ("Plugge, Joe R." <JRPlugge@west.com>)
List pgsql-performance
On Sun, Feb 28, 2010 at 8:09 PM, Plugge, Joe R. <JRPlugge@west.com> wrote:
> I have a very busy system that takes about 9 million inserts per day and each record gets updated at least once after
theinsert (all for the one same table), there are other tables that get hit but not as severely.  As suspected I am
havinga problem with table bloat.  Any advice on how to be more aggressive with autovacuum?  I am using 8.4.1.  My
machinehas 4 Intel Xeon  3000 MHz Processors with 8 GB of Ram. 

What kind of drive system do you have?  That's far more important than
CPU and RAM.

Let's look at a two pronged attack.  1: What can you maybe do to
reduce the number of updates for each row.  if you do something like:

update row set field1='xyz' where id=4;
update row set field2='www' where id=4;

And you can combine those updates, that's a big savings.

Can you benefit from HOT updates by removing some indexes?  Updating
indexed fields can cost a fair bit more than updating indexed ones IF
you have a < 100% fill factor and therefore free room in each page for
a few extra rows.

2: Vacuum tuning.

>
> Currently I am using only defaults for autovac.

This one:

> #autovacuum_vacuum_cost_delay = 20ms

is very high for a busy system with a powerful io subsystem.  I run my
production servers with 1ms to 4ms so they can keep up.

Lastly there are some settings you can make per table for autovac you
can look into (i.e. set cost_delay to 0 for this table), or you can
turn off autovac for this one table and then run a regular vac with no
cost_delay on it every minute or two.

pgsql-performance by date:

Previous
From: "Plugge, Joe R."
Date:
Subject: Autovacuum Tuning advice
Next
From: Greg Williamson
Date:
Subject: Re: Autovacuum Tuning advice