Received: from localhost (maia-5.hub.org [200.46.204.182]) by postgresql.org (Postfix) with ESMTP id A787A9FB97B for ; Thu, 26 Apr 2007 12:37:50 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.182]) (amavisd-maia, port 10024) with ESMTP id 84838-04 for ; Thu, 26 Apr 2007 12:37:46 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by postgresql.org (Postfix) with ESMTP id DC5BB9FB916 for ; Thu, 26 Apr 2007 12:37:46 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.13.6/8.13.6) with ESMTP id l3QFbgw3024355; Thu, 26 Apr 2007 11:37:42 -0400 (EDT) To: Bill Moran cc: Jim Nasby , Postgresql list Performance Subject: Re: Fragmentation of WAL files In-reply-to: <20070426080050.522ef7b5.wmoran@collaborativefusion.com> References: <3BD44C5D-E402-43EB-8FFD-1A4BC97AFD0C@decibel.org> <20070426080050.522ef7b5.wmoran@collaborativefusion.com> Comments: In-reply-to Bill Moran message dated "Thu, 26 Apr 2007 08:00:50 -0400" Date: Thu, 26 Apr 2007 11:37:42 -0400 Message-ID: <24354.1177601862@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200704/429 X-Sequence-Number: 24306 > In response to Jim Nasby : >> I was recently running defrag on my windows/parallels VM and noticed >> a bunch of WAL files that defrag couldn't take care of, presumably >> because the database was running. What's disturbing to me is that >> these files all had ~2000 fragments. It sounds like that filesystem is too stupid to coalesce successive write() calls into one allocation fragment :-(. I agree with the comments that this might not be important, but you could experiment to see --- try increasing the size of "zbuffer" in XLogFileInit to maybe 16*XLOG_BLCKSZ, re-initdb, and see if performance improves. The suggestion to use ftruncate is so full of holes that I won't bother to point them all out, but certainly we could write more than just XLOG_BLCKSZ at a time while preparing the file. regards, tom lane