Re: Autovacuum Tuning advice

From: Scott Marlowe <scott(dot)marlowe(at)gmail(dot)com>
To: "Plugge, Joe R(dot)" <JRPlugge(at)west(dot)com>
Cc: "pgsql-performance(at)postgresql(dot)org" <pgsql-performance(at)postgresql(dot)org>
Subject: Re: Autovacuum Tuning advice
Date: 2010-03-01 06:58:28
Message-ID: dcc563d11002282258k2a7d55b1u8f111db99bf6f954@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

On Sun, Feb 28, 2010 at 8:09 PM, Plugge, Joe R. <JRPlugge(at)west(dot)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 the insert (all for the one same table), there are other tables that get hit but not as severely.  As suspected I am having a problem with table bloat.  Any advice on how to be more aggressive with autovacuum?  I am using 8.4.1.  My machine has 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.

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Greg Williamson 2010-03-01 07:08:02 Re: Autovacuum Tuning advice
Previous Message Plugge, Joe R. 2010-03-01 03:09:04 Autovacuum Tuning advice