X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id BB7993A2358 for ; Sat, 15 Jan 2005 01:35:43 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 47591-09 for ; Sat, 15 Jan 2005 01:35:30 +0000 (GMT) Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by svr1.postgresql.org (Postfix) with ESMTP id 74D103A232C for ; Sat, 15 Jan 2005 01:35:32 +0000 (GMT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.13.1/8.13.1) with ESMTP id j0F1ZWeH027797; Fri, 14 Jan 2005 20:35:32 -0500 (EST) To: cjwhite@cisco.com Cc: pgsql-admin@postgresql.org Subject: Re: Limiting size and number of transaction logs In-reply-to: <200501150031.j0F0VoRO019354@sj-core-3.cisco.com> References: <200501150031.j0F0VoRO019354@sj-core-3.cisco.com> Comments: In-reply-to "Chris White (cjwhite)" message dated "Fri, 14 Jan 2005 16:31:50 -0800" Date: Fri, 14 Jan 2005 20:35:31 -0500 Message-ID: <27796.1105752931@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.004 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200501/158 X-Sequence-Number: 16017 "Chris White (cjwhite)" writes: > In the documentation for 7.4 for WAL configuration, I see the following > statement: > There will be at least one 16 MB segment file, and will normally not be more > than 2 * checkpoint_segments + 1 files. > So if I have 1 checkpoint segment configured, does this mean there will be a > max of 4 16MB files or 3 16MB files. Note the word "normally" --- there's no guarantees here. A spike in WAL output rate could result in more WAL segments than usual. But if you have checkpoint_segments = 1 and the system never generates more than 16MB of WAL output before the next checkpoint can complete, there'd probably be only two WAL segments. The formula says three, but what that actually means is that the checkpoint logic will allow up to three to exist without trying to get rid of any. I think that with a low enough output rate, it would flip between two segments without ever trying to make a third one. > Is there anyway of reducing this number of files, as I am running on a > system which is very tight on disk space and doesn't have that much DB > transaction throughput that needs this number of transaction logs or is > there a way of making the size smaller? In 8.0 the segment size can be configured at compile time, but I don't think I'd risk it in earlier releases. regards, tom lane