Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id E8F3E1337B5E for ; Fri, 7 Jan 2011 09:47:32 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 02195-08 for ; Fri, 7 Jan 2011 13:47:25 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mail.anarazel.de (mail.anarazel.de [217.115.131.40]) by mail.postgresql.org (Postfix) with ESMTP id BFEC613364DE for ; Fri, 7 Jan 2011 09:47:25 -0400 (AST) Received: from alap2.localnet (p579FBE52.dip.t-dialin.net [87.159.190.82]) by mail.anarazel.de (Postfix) with ESMTPSA id B2708448004; Fri, 7 Jan 2011 14:47:25 +0100 (CET) From: Andres Freund To: Florian Weimer Subject: Re: Wrong docs on checkpoint_segments? Date: Fri, 7 Jan 2011 14:47:24 +0100 User-Agent: KMail/1.13.5 (Linux/2.6.37-rc6-andres-00186-ge5fcdb7; KDE/4.5.90; x86_64; ; ) Cc: pgsql-performance@postgresql.org References: <82aajcg9wa.fsf@mid.bfk.de> <201101071439.32053.andres@anarazel.de> <82mxnceskh.fsf@mid.bfk.de> In-Reply-To: <82mxnceskh.fsf@mid.bfk.de> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201101071447.24345.andres@anarazel.de> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.91 tagged_above=-10 required=5 tests=BAYES_00=-1.9, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201101/44 X-Sequence-Number: 41831 On Friday, January 07, 2011 02:45:02 PM Florian Weimer wrote: > * Andres Freund: > > On Friday, January 07, 2011 01:45:25 PM Florian Weimer wrote: > >> On 9.0, this configuration > >> > >> checkpoint_segments = 512 # in logfile segments, min 1, 16MB each > >> > >> results in 1034 segments, so the effective logfile segment size is 32 > >> MB. > > > > Um. Is it possible that you redefined XLOG_SEG_SIZE or used --with-wal- > > segsize=SEGSIZE? > > No, the individual files are still 16 MB. It's just that the > checkpoint_segments limit is not a hard limit, and you end up with > slightly more than twice the configured number of segments on disk. Thats documented: " There will always be at least one WAL segment file, and will normally not be more files than the higher of wal_keep_segments or (2 + checkpoint_completion_target) * checkpoint_segments + 1. Each segment file is normally 16 MB (though this size can be altered when building the server). You can use this to estimate space requirements for WAL. Ordinarily, when old log segment files are no longer needed, they are recycled (renamed to become the next segments in the numbered sequence). If, due to a short-term peak of log output rate, there are more than 3 * checkpoint_segments + 1 segment files, the unneeded segment files will be deleted instead of recycled until the system gets back under this limit. " Andres