Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id BB0821337B61 for ; Thu, 17 Mar 2011 22:08:15 -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 17976-03 for ; Fri, 18 Mar 2011 01:08:08 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from marajade.localdomain (vcs5.camavision.com [63.228.164.252]) by mail.postgresql.org (Postfix) with ESMTP id 653481337B49 for ; Thu, 17 Mar 2011 22:08:07 -0300 (ADT) Received: from [192.168.1.116] (173-31-201-111.client.mchsi.com [173.31.201.111]) (Authenticated sender: andy) by marajade.localdomain (Postfix) with ESMTPA id BDA274374F; Thu, 17 Mar 2011 20:08:06 -0500 (CDT) Message-ID: <4D82B075.7070202@squeakycode.net> Date: Thu, 17 Mar 2011 20:08:05 -0500 From: Andy Colson User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.15) Gecko/20110303 Lightning/1.0b2 Thunderbird/3.1.9 MIME-Version: 1.0 To: Michael Andreasen CC: pgsql-performance@postgresql.org Subject: Re: Fastest pq_restore? References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit 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 X-Spam-Level: X-Archive-Number: 201103/196 X-Sequence-Number: 42875 On 03/17/2011 09:25 AM, Michael Andreasen wrote: > Hi, > > I've been looking around for information on doing a pg_restore as fast as possible. It is for a backup machine so I am not interested in anything like crash recovery or anything else that would impact speed of load. I just want to go from no database to database there as fast as possible. The server is for postgresql only and this is the only database, sp both system at postgres can be set however is required for the fast load. > > Currently I am using a twin processor box with 2GB of memory and raid 5 disk. > > I start postgres before my load with these settings, which have been suggested. > > > shared_buffers = 496MB > maintenance_work_mem = 160MB > checkpoint_segments = 30 > autovacuum = false > full_page_writes=false > > maintenance_work_mem and checkpoint_segments were advised to be increased, which I have done, but these are just guess values as I couldn't see any advise for values, other than "bigger". > > > I restore like this; > > pg_restore -Fc -j 4 -i -O -d my_db my_db_dump.tbz > > > Even as this, it is still slower than I would like. > > Can someone suggest some optimal settings (for postgresql 9) that will get this as quick as it can be? > > Thanks. > > > > > autovacuum = off fsync = off synchronous_commit = off full_page_writes = off bgwriter_lru_maxpages = 0 -Andy