Received: from localhost (wm.hub.org [200.46.204.128]) by postgresql.org (Postfix) with ESMTP id 4CAAB9FB22F for ; Mon, 2 Oct 2006 13:25:27 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) with ESMTP id 20516-01 for ; Mon, 2 Oct 2006 16:25:20 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey- Received: from sand1.gxn.net (sand1.gxn.net [195.147.249.207]) by postgresql.org (Postfix) with ESMTP id 580139FB1DA for ; Mon, 2 Oct 2006 13:25:20 -0300 (ADT) Received: from [62.232.55.86] (helo=[192.168.0.26]) by sand1.gxn.net with esmtp (Exim 4.50) id 1GUQhP-0001eZ-3Z; Mon, 02 Oct 2006 17:31:23 +0100 Subject: Re: archive wal's failure and load increase. From: Simon Riggs To: Tom Lane Cc: cedric@dreamgnu.com, pgsql-performance@postgresql.org In-Reply-To: <16749.1159545336@sss.pgh.pa.us> References: <451C2572.20800@dreamgnu.com> <1159527513.2767.296.camel@holly> <15270.1159540162@sss.pgh.pa.us> <1159541620.2649.10.camel@holly> <16749.1159545336@sss.pgh.pa.us> Content-Type: text/plain Date: Mon, 02 Oct 2006 17:25:13 +0100 Message-Id: <1159806313.2659.214.camel@holly> Mime-Version: 1.0 X-Mailer: Evolution 2.6.2 (2.6.2-1.fc5.5) Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests= X-Spam-Level: X-Archive-Number: 200610/7 X-Sequence-Number: 21136 On Fri, 2006-09-29 at 11:55 -0400, Tom Lane wrote: > Simon Riggs writes: > > PreallocXlogFiles() adds only a *single* xlog file, sometimes. > > Hm, you are right. I wonder why it's so unaggressive ... perhaps > because under normal circumstances we soon settle into a steady > state where each checkpoint recycles the right number of files. That is normally the case, yes. But only for people that have correctly judged (or massively overestimated) what checkpoint_segments should be set at. Currently, when we don't have enough we add one, maybe. When we have too many we truncate right back to checkpoint_segments as quickly as possible. Seems like we should try and automate that completely for 8.3: - calculate the number required by keeping a running average which ignores a single peak value, yet takes 5 consistently high values as the new average - add more segments with increasing aggressiveness 1,1,2,3,5,8 segments at a time when required - handle out-of-space errors fairly gracefully by waking up the archiver, complaining to the logs and then eventually preventing transactions from writing to logs rather than taking server down - shrink back more slowly by halving the difference between the overlimit and the typical value - get rid of checkpoint_segments GUC That should handle peaks caused by data loads, archiving interruptions or other peak loadings. -- Simon Riggs EnterpriseDB http://www.enterprisedb.com