Received: from localhost (unknown [200.46.204.183]) by developer.postgresql.org (Postfix) with ESMTP id E622B2E0069 for ; Wed, 16 Apr 2008 16:45:36 -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 77101-02 for ; Wed, 16 Apr 2008 16:45:33 -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 027A92E005E for ; Wed, 16 Apr 2008 16:45:33 -0300 (ADT) Received: from westnet.com (localhost [127.0.0.1]) by westnet.com (8.14.0/8.14.0) with ESMTP id m3GJjNU5006357; Wed, 16 Apr 2008 15:45:23 -0400 (EDT) Received: from localhost (gsmith@localhost) by westnet.com (8.14.0/8.13.2/Submit) with ESMTP id m3GJjNNf006352; Wed, 16 Apr 2008 15:45:23 -0400 (EDT) X-Authentication-Warning: westnet.com: gsmith owned process doing -bs Date: Wed, 16 Apr 2008 15:45:22 -0400 (EDT) From: Greg Smith X-X-Sender: gsmith@westnet.com To: Marinos Yannikos cc: pgsql-performance@postgresql.org Subject: Re: Background writer underemphasized ... In-Reply-To: <480619CA.2080904@geizhals.at> Message-ID: References: <480619CA.2080904@geizhals.at> 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/209 X-Sequence-Number: 29702 On Wed, 16 Apr 2008, Marinos Yannikos wrote: > to save some people a headache or two: I believe we just solved our > performance problem in the following scenario: I was about to ask your PostgreSQL version but since I see you mention wal_writer_delay it must be 8.3. Knowing your settings for shared_buffers and checkpoint_segments in particular would make this easier to understand. You also didn't mention what disk controller you have, or how much write cache it has (if any). > This helped with our configuration: > bgwriter_delay = 10000ms # 10-10000ms between rounds > bgwriter_lru_maxpages = 1000 # 0-1000 max buffers written/round The default for bgwriter_delay is 200ms = 5 passes/second. You're increasing that to 10000ms means one pass every 10 seconds instead. That's almost turning the background writer off. If that's what improved your situation, you might as well as turn it off altogether by setting all the bgwriter_lru_maxpages parameters to be 0. The combination you describe here, running very infrequently but with lru_maxpages set to its maximum, is a bit odd. > Other options we have tried/used were shared_buffers between 200MB and > 20GB, wal_buffers = 256MB, wal_writer_delay=5000ms ... The useful range for wal_buffers tops at around 1MB, so no need to get extreme there. wal_writer_delay shouldn't matter here unless you turned on asyncronous commit. -- * Greg Smith gsmith@gregsmith.com http://www.gregsmith.com Baltimore, MD