Received: from localhost (unknown [200.46.204.184]) by developer.postgresql.org (Postfix) with ESMTP id 864882E0092 for ; Wed, 16 Apr 2008 15:48:23 -0300 (ADT) Received: from developer.postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-maia, port 10024) with ESMTP id 30323-01 for ; Wed, 16 Apr 2008 15:48:10 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from mx00.pub.collaborativefusion.com (mx00.pub.collaborativefusion.com [206.210.89.199]) by developer.postgresql.org (Postfix) with ESMTP id 467112E0204 for ; Wed, 16 Apr 2008 15:43:36 -0300 (ADT) Received: from vanquish.ws.pitbpa0.priv.collaborativefusion.com (vanquish.ws.pitbpa0.priv.collaborativefusion.com [192.168.2.162]) (SSL: TLSv1/SSLv3,256bits,AES256-SHA) by wingspan with esmtp; Wed, 16 Apr 2008 14:44:32 -0400 id 00056414.48064910.00016CFA Date: Wed, 16 Apr 2008 14:43:35 -0400 From: Bill Moran To: Marinos Yannikos Cc: pgsql-performance@postgresql.org Subject: Re: Background writer underemphasized ... Message-Id: <20080416144335.04368b67.wmoran@collaborativefusion.com> In-Reply-To: <480619CA.2080904@geizhals.at> References: <480619CA.2080904@geizhals.at> Organization: Collaborative Fusion X-Mailer: Sylpheed 2.4.8 (GTK+ 2.12.9; i386-portbld-freebsd7.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200804/206 X-Sequence-Number: 29699 In response to Marinos Yannikos : > Hi, > > to save some people a headache or two: I believe we just solved our > performance problem in the following scenario: > > - Linux 2.6.24.4 > - lots of RAM (32GB) > - enough CPU power (4 cores) > - disks with relatively slow random writes (SATA RAID-5 / 7 disks, 128K > stripe, ext2) > > Our database is around 86GB, the busy parts being 20-30GB. Typical load > is regular reads of all sizes (large joins, sequential scans on a 8GB > table, many small selects with few rows) interspersed with writes of > several 1000s rows on the busier tables by several clients. > > After many tests and research revolving around the Linux I/O-Schedulers > (which still have some issues one should be wary about: > http://lwn.net/Articles/216853/) because we saw problems when occasional > (intensive) writes completely starved all I/O, we discovered that > changing the default settings for the background writer seems to have > solved all these problems. Performance is much better now with fsync on > than it was with fsync off previously, no other configuration options > had a noticeable effect on performance (or these problems rather). > > This helped with our configuration: > bgwriter_delay = 10000ms # 10-10000ms between rounds > bgwriter_lru_maxpages = 1000 # 0-1000 max buffers written/round What other values have you tried for this? Have you watched closely under load to ensure that you're not seeing a huge performance hit every 10s when the bgwriter kicks off? I'm with Chris -- I would be inclined to try a range of values to find a sweet spot, and I would be _very_ shocked to find that sweet spot at the values you mention. However, if that really is the demonstrable sweet spot, there may be something we all can learn. -- Bill Moran Collaborative Fusion Inc. http://people.collaborativefusion.com/~wmoran/ wmoran@collaborativefusion.com Phone: 412-422-3463x4023