Received: from localhost (unknown [200.46.204.183]) by developer.postgresql.org (Postfix) with ESMTP id 5D6B52E0096 for ; Mon, 28 Apr 2008 15:16:16 -0300 (ADT) Received: from developer.postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 30438-03-6 for ; Mon, 28 Apr 2008 15:16:12 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from westnet.com (westnet.com [216.187.52.2]) by developer.postgresql.org (Postfix) with ESMTP id 875C92E00C7 for ; Mon, 28 Apr 2008 15:16:03 -0300 (ADT) Received: from westnet.com (localhost [127.0.0.1]) by westnet.com (8.14.0/8.14.0) with ESMTP id m3SIG2kV004523; Mon, 28 Apr 2008 14:16:02 -0400 (EDT) Received: from localhost (gsmith@localhost) by westnet.com (8.14.0/8.13.2/Submit) with ESMTP id m3SIG29X004510; Mon, 28 Apr 2008 14:16:02 -0400 (EDT) X-Authentication-Warning: westnet.com: gsmith owned process doing -bs Date: Mon, 28 Apr 2008 14:16:02 -0400 (EDT) From: Greg Smith X-X-Sender: gsmith@westnet.com To: John Rouillard cc: pgsql-performance@postgresql.org Subject: Re: Very poor performance loading 100M of sql data using copy In-Reply-To: <20080428172431.GI6622@renesys.com> Message-ID: References: <20080428172431.GI6622@renesys.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200804/409 X-Sequence-Number: 29902 On Mon, 28 Apr 2008, John Rouillard wrote: > 2008-04-21 11:36:43 UTC @(2761)i: LOG: checkpoints ... (27 seconds apart) > so I changed: > checkpoint_segments = 30 > checkpoint_warning = 150 That's good, but you might go higher than 30 for a bulk loading operation like this, particularly on 8.1 where checkpoints are no fun. Using 100 is not unreasonable. > shared_buffers = 3000 > I don't see any indication in the docs that increasing shared memory > would help speed up a copy operation. The index blocks use buffer space, and what ends up happening if there's not enough memory is they are written out more than they need to be (and with your I/O hardware you need to avoid writes unless absolutely necessary). Theoretically the OS is caching around that situation but better to avoid it. You didn't say how much RAM you have, but you should start by a factor of 10 increase to 30,000 and see if that helps; if so, try making it large enough to use 1/4 of total server memory. 3000 is only giving the server 24MB of RAM to work with, and it's unfair to expect it to work well in that situation. While not relevant to this exercise you'll need to set effective_cache_size to a useful value one day as well. -- * Greg Smith gsmith@gregsmith.com http://www.gregsmith.com Baltimore, MD