From: Greg Smith <greg@2ndQuadrant.com>
To: pgsql-performance@postgresql.org
Subject: Re: How to configure a read-only database server?
Date: Tue, 19 Apr 2011 10:30:48 -0400
Message-ID: <4DAD9C98.5090707@2ndQuadrant.com> (raw)
In-Reply-To: <BANLkTinA9B=80cG8R=132RTxF52K=Mdfuw@mail.gmail.com>
References: <BANLkTinA9B=80cG8R=132RTxF52K=Mdfuw@mail.gmail.com>
On 04/18/2011 06:08 PM, Stefan Keller wrote:
> * What about wal_level and archive_mode?
>
Presumably you don't care about either of these. wal_level=minimal,
archive_mode=off.
The other non-obvious thing you should do in this situation is do all
the database maintenance in one big run after the data is loaded,
something like:
VACUUM FREEZE ANALYZE;
Otherwise you will still have some trickle of write-activity going on,
not always efficiently, despite being in read-only mode. It's because
of what's referred to as Hint Bits:
http://wiki.postgresql.org/wiki/Hint_Bits
VACUUMing everything will clean those us, and freezing everything makes
sure there's no old transactions to concerned about that might kick off
anti-wraparound autovacuum.
The only other thing you probably want to do is set checkpoint_segments
to a big number. Shouldn't matter normally, but when doing this freeze
operation it will help that execute quickly. You want a lower
maintenance_work_mem on a read-only system than the master too, possibly
a higher shared_buffers as well. It's all pretty subtle beyond the big
parameters you already identified.
--
Greg Smith 2ndQuadrant US greg@2ndQuadrant.com Baltimore, MD
PostgreSQL Training, Services, and 24x7 Support www.2ndQuadrant.us
"PostgreSQL 9.0 High Performance": http://www.2ndQuadrant.com/books
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: greg@2ndQuadrant.com
Subject: Re: How to configure a read-only database server?
In-Reply-To: <4DAD9C98.5090707@2ndQuadrant.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