Received: from localhost (maia-5.hub.org [200.46.204.182]) by postgresql.org (Postfix) with ESMTP id DB6079FA136 for ; Sat, 2 Dec 2006 22:15:03 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.182]) (amavisd-new, port 10024) with ESMTP id 72911-03 for ; Sat, 2 Dec 2006 22:14:53 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from exchange.g2switchworks.com (mail.g2switchworks.com [63.87.162.25]) by postgresql.org (Postfix) with ESMTP id D8B269F938C for ; Sat, 2 Dec 2006 22:14:58 -0400 (AST) Received: from 10.10.1.93 ([10.10.1.93]) by exchange.g2switchworks.com ([10.10.1.2]) with Microsoft Exchange Server HTTP-DAV ; Sun, 3 Dec 2006 02:14:54 +0000 Received: from localhost.localdomain by mail.g2switchworks.com; 02 Dec 2006 20:14:48 -0600 Subject: Re: Settings for writing! From: Scott Marlowe To: jose fuenmayor Cc: pgsql-admin@postgresql.org In-Reply-To: <69f2062a0611200521x5bf10321u906d8ca215485fd6@mail.gmail.com> References: <69f2062a0611200521x5bf10321u906d8ca215485fd6@mail.gmail.com> Content-Type: text/plain Content-Transfer-Encoding: 7bit Date: Sat, 02 Dec 2006 20:14:47 -0600 Message-Id: <1165112087.25316.25.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Evolution 2.2.2 (2.2.2-5) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200612/21 X-Sequence-Number: 23813 On Mon, 2006-11-20 at 13:21 +0000, jose fuenmayor wrote: > Hi all, which paramaters can I modify in order to improve performance > in wirting tasks (updates,inserts,copy), I have a database where there > is a lot of writing, i have increase the shared_buffers but it seems > to improve just the reading which are really fast (I have a table with > like > 87 000 000 rows, the problem goes when writing) Writing speed is normally more about HOW you write, and the hardware you're writing to. Can you group your writing queries into groups in a single larger query? I.e. begin; insert (100 times) commit; You can also get some help sometimes by playing about with these settings: #wal_buffers = 8 # min 4, 8KB each #commit_delay = 0 # range 0-100000, in microseconds #commit_siblings = 5 # range 1-1000 # - Checkpoints - #checkpoint_segments = 3 # in logfile segments, min 1, 16MB each #checkpoint_timeout = 300 # range 30-3600, in seconds #checkpoint_warning = 30 # 0 is off, in seconds especially commit_siblings. But the biggest improvement can come from hardware. Using a battery backed caching RAID controller is generally the primary answer. Areca, LSI (megaraid) and the 3WARE series controllers get good reviews, with the Areca coming in ahead by some small percentage performancewise, and the LSI having a lead in reported reliability / maturity of the driver. Using layered RAID is often a big help too. Having a RAID 1+0 (a bunch of mirror sets (RAID1) combined in a stripe set (RAID0) gives very good write and read performance and the best reliability. This is a question, btw, best answered on pgsql-perform. Admin is more about backing up, creating users, managing schemas, etc... Good luck with your system.