Re: autovacuum settings

From: Jim Nasby <jnasby(at)pervasive(dot)com>
To: Jebus <lordjebus(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: autovacuum settings
Date: 2006-04-06 21:29:11
Message-ID: A2697B8B-FE69-4294-90B3-4AD45AA672C0@pervasive.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Apr 6, 2006, at 8:57 AM, Jebus wrote:

> I am totally new to postgres and I wondering what settings should I be
> using for autovacuum ?
> For now I just uncommented all the defaults, is this good enough ? The
> database is not large but it is a web database so there is a lot of
> inserts and updates.

There's no reason to uncomment the defaults. They're defaults. :)
Unless you change settings they'll be used.

> autovacuum = on # enable autovacuum
> subprocess?
> autovacuum_naptime = 60 # time between autovacuum
> runs, in secs
> autovacuum_vacuum_threshold = 1000 # min # of tuple updates
> before
> # vacuum
> autovacuum_analyze_threshold = 500 # min # of tuple updates
> before
> # analyze
> autovacuum_vacuum_scale_factor = 0.4 # fraction of rel size before
> # vacuum
> autovacuum_analyze_scale_factor = 0.2 # fraction of rel size before
> # analyze

I recommend cutting the above 4 parameters in half.

> autovacuum_vacuum_cost_delay = -1 # default vacuum cost delay
> for
> # autovac, -1 means use
> # vacuum_cost_delay
> autovacuum_vacuum_cost_limit = -1 # default vacuum cost limit
> for
> # autovac, -1 means use
> # vacuum_cost_limit
>
>
> I also uncommented this too I am not what they are though ?
>
> vacuum_cost_delay = 0 # 0-1000 milliseconds

If you set vacuum_cost_delay > 0 then every time vacuum accumulates
enough 'credits' it will sleep for that long. So with the default
settings below, vacuum would sleep after dirtying 10 pages. Or
reading 20 pages that weren't in PostgreSQL's buffer (that cost is
probably too high, depending on how much memory you have on the server).

> vacuum_cost_page_hit = 1 # 0-10000 credits
> vacuum_cost_page_miss = 10 # 0-10000 credits
> vacuum_cost_page_dirty = 20 # 0-10000 credits
> vacuum_cost_limit = 200 # 0-10000 credits
>
> ---------------------------(end of
> broadcast)---------------------------
> TIP 1: if posting/reading through Usenet, please send an appropriate
> subscribe-nomail command to majordomo(at)postgresql(dot)org so that
> your
> message can get through to the mailing list cleanly
>

--
Jim C. Nasby, Database Architect decibel(at)decibel(dot)org
Give your computer some brain candy! www.distributed.net Team #1828

Windows: "Where do you want to go today?"
Linux: "Where do you want to go tomorrow?"
FreeBSD: "Are you guys coming, or what?"

--
Jim C. Nasby, Sr. Engineering Consultant jnasby(at)pervasive(dot)com
Pervasive Software http://pervasive.com work: 512-231-6117
vcard: http://jim.nasby.net/pervasive.vcf cell: 512-569-9461

In response to

Browse pgsql-general by date

  From Date Subject
Next Message lmyho 2006-04-06 21:39:44 Re: Debian package for freeradius_postgresql module
Previous Message Martijn van Oosterhout 2006-04-06 21:19:52 Re: Debian package for freeradius_postgresql module