pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Scott Marlowe <scott.marlowe@gmail.com>
To: Bhella Paramjeet-PFCW67 <PBhella@motorola.com>
Cc: pgsql-admin@postgresql.org
Cc: pgsql-performance@postgresql.org
Subject: Re: tuning auto vacuum for highly active tables
Date: Tue, 23 Mar 2010 15:41:48 -0600
Message-ID: <dcc563d11003231441m6ec903d1k2370a38e52c2bba4@mail.gmail.com> (raw)
In-Reply-To: <C84662912D280D4AB5C50100A100F0C50574C753@ct11exm61.ds.mot.com>
References: <C84662912D280D4AB5C50100A100F0C50574C753@ct11exm61.ds.mot.com>

On Tue, Mar 23, 2010 at 2:54 PM, Bhella Paramjeet-PFCW67
<PBhella@motorola.com> wrote:
> Hi All,
>
>
>
> We have a postgres database in which couple of tables get bloated due to
> heavy inserts and deletes. Auto vacuum is running. My question is  how can I
> make auto vacuum more aggressive? I am thinking of enabling
> autovacuum_vacuum_cost_delay and autovacuum_vacuum_cost_limit parameters.
> Can anyone suggest how to calculate the appropriate values for these
> parameters and if there are any side effects of enabling these parameters.
>  Any help will be highly appreciated.

OK, autovacuum runs x number of threads, and these threads can have
their IO impact limited by cost delay and cost limit.

Your first choice is based a lot on your db needs.  If you have a lot
of large tables that all need to be vacuumed a lot, then you might
want to first increase the number of threads before making any of them
more aggressive.  Then you might want to make the vacuums more
aggressive by lower cost_delay down from 20 to 10 or 5 or so
milliseconds.

On our servers we run 6 threads with a cost_delay of 3 or 4
milliseconds, and autovacuum keeps up without getting in the way.  We
have a decent DAS array, so we can handle a lot of vacuum threads
running at once before they become an issue.

The smaller your disk set, the less you can throw vacuum at it and not
expect it to mess up the rest of the app.  It's all a trade off, but
if you don't have more than a disk or two to throw at your db don't
expect vacuum to keep up with really heavy activity without impacting
your system's performance.



view thread (8+ messages)  latest in thread

Message-ID: <dcc563d11003231441m6ec903d1k2370a38e52c2bba4@mail.gmail.com>
Permalink:  ../dcc563d11003231441m6ec903d1k2370a38e52c2bba4@mail.gmail.com/
Also on:    postgresql.org/message-id/dcc563d11003231441m6ec903d1k2370a38e52c2bba4@mail.gmail.com

 · 

reply

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, PBhella@motorola.com, pgsql-admin@postgresql.org
  Subject: Re: tuning auto vacuum for highly active tables
  In-Reply-To: <dcc563d11003231441m6ec903d1k2370a38e52c2bba4@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