Re: How to configure a read-only database server?

From: Greg Smith <greg(at)2ndQuadrant(dot)com>
To: pgsql-performance(at)postgresql(dot)org
Subject: Re: How to configure a read-only database server?
Date: 2011-04-19 14:30:48
Message-ID: 4DAD9C98.5090707@2ndQuadrant.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

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(at)2ndQuadrant(dot)com Baltimore, MD
PostgreSQL Training, Services, and 24x7 Support www.2ndQuadrant.us
"PostgreSQL 9.0 High Performance": http://www.2ndQuadrant.com/books

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Josh Berkus 2011-04-20 01:50:40 Re: Shouldn't we have a way to avoid "risky" plans?
Previous Message Robert Haas 2011-04-19 14:29:13 Re: Shouldn't we have a way to avoid "risky" plans?