Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id A67BB1337B54 for ; Tue, 19 Apr 2011 11:30:24 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 26451-07 for ; Tue, 19 Apr 2011 14:30:05 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from moutng.kundenserver.de (moutng.kundenserver.de [212.227.126.187]) by mail.postgresql.org (Postfix) with ESMTP id E69DD1337BCC for ; Tue, 19 Apr 2011 11:29:58 -0300 (ADT) Received: from [192.168.1.6] (mail.highperformancepostgresql.com [71.179.240.8]) by mrelayeu.kundenserver.de (node=mrbap3) with ESMTP (Nemesis) id 0MT82Y-1QKXdg3BLy-00S76G; Tue, 19 Apr 2011 16:29:59 +0200 Message-ID: <4DAD9C98.5090707@2ndQuadrant.com> Date: Tue, 19 Apr 2011 10:30:48 -0400 From: Greg Smith User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.16) Gecko/20110307 Icedove/3.0.11 MIME-Version: 1.0 To: pgsql-performance@postgresql.org Subject: Re: How to configure a read-only database server? References: In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Provags-ID: V02:K0:WcD6qAll9zxYkyKzfuxUV4ppeIsbJBErIn/z9fJ0tIZ rp+8RKNbZECZ5RFGVhSUm24wUvyCflGQIbMSPodLW3EoQiabh9 4N6K0NF5hCwiIf5TT/thnG1XL7N25PQSL+dHAtAGD37DEJ64X3 WXStcdNqdJN/oKoS2G3cfTN2cNhiSuianxMdWaSZOy/fyKkcCh aa6iD2kTaOnJcFhbyEsT7qZFZhoaSrCRGBwf0Z4tws= X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.9 tagged_above=-10 required=5 tests=BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001 X-Spam-Level: X-Archive-Number: 201104/274 X-Sequence-Number: 43336 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