From: Scott Marlowe <scott.marlowe@gmail.com>
To: Plugge, Joe R. <JRPlugge@west.com>
Cc: pgsql-performance@postgresql.org <pgsql-performance@postgresql.org>
Subject: Re: Autovacuum Tuning advice
Date: Sun, 28 Feb 2010 23:58:28 -0700
Message-ID: <dcc563d11002282258k2a7d55b1u8f111db99bf6f954@mail.gmail.com> (raw)
In-Reply-To: <E2160D87-855A-49E9-8704-D6389A76C2F3@mimectl>
References: <4AB8D9AA.6050007@ummon.com>
<4AB8E145.4040901@squeakycode.net>
<E2160D87-855A-49E9-8704-D6389A76C2F3@mimectl>
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 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.
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-performance@postgresql.org
Cc: scott.marlowe@gmail.com, JRPlugge@west.com
Subject: Re: Autovacuum Tuning advice
In-Reply-To: <dcc563d11002282258k2a7d55b1u8f111db99bf6f954@mail.gmail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox