Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id B76984760CC for ; Tue, 5 Nov 2002 08:30:10 -0500 (EST) Received: from anchor-post-31.mail.demon.net (anchor-post-31.mail.demon.net [194.217.242.89]) by postgresql.org (Postfix) with ESMTP id 75DBA476048 for ; Tue, 5 Nov 2002 08:30:08 -0500 (EST) Received: from mwynhau.demon.co.uk ([193.237.186.96] helo=mainbox.archonet.com) by anchor-post-31.mail.demon.net with esmtp (Exim 3.35 #1) id 1893mN-000HAA-0V; Tue, 05 Nov 2002 13:30:03 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by mainbox.archonet.com (Postfix) with ESMTP id E6C57178DE; Tue, 5 Nov 2002 13:16:56 +0000 (GMT) Received: from client.archonet.com (client.archonet.com [192.168.1.16]) by mainbox.archonet.com (Postfix) with ESMTP id 5950E178DD; Tue, 5 Nov 2002 13:16:56 +0000 (GMT) Content-Type: text/plain; charset="iso-8859-1" From: Richard Huxton Organization: Archonet Ltd To: Florian Litot , pgsql-general@postgresql.org Subject: Re: log file? Date: Tue, 5 Nov 2002 13:17:04 +0000 User-Agent: KMail/1.4.3 References: <4.3.2.7.2.20021105121304.022c5100@pop.besancon.tt.slb.com> <4.3.2.7.2.20021105134126.0236f100@pop.besancon.tt.slb.com> In-Reply-To: <4.3.2.7.2.20021105134126.0236f100@pop.besancon.tt.slb.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Message-Id: <200211051317.04395.dev@archonet.com> X-Virus-Scanned: by AMaViS snapshot-20020531 X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200211/160 X-Sequence-Number: 32581 On Tuesday 05 Nov 2002 12:48 pm, Florian Litot wrote: > At 12:47 05/11/02, Richard Huxton wrote: > >How many files are there in pg_xlog and what dates do they have? > >What are the WAL settings in your postgresql.conf file? > >Do you have any clients that have been running a long time? > i have got 66 files > i have got a new file to 16 minutes > wal_files =3D 64 # range 0-64 > #wal_sync_method =3D fsync # the default varies across platforms: > # # fsync, fdatasync, open_sync, or open_datasync > #wal_debug =3D 0 # range 0-16 > #commit_delay =3D 0 # range 0-100000 > #commit_siblings =3D 5 # range 1-1000 > #checkpoint_segments =3D 3 # in logfile segments (16MB each), min 1 > #checkpoint_timeout =3D 300 # in seconds, range 30-3600 > #fsync =3D true > > it's standard > i make some insertion i make 1 insertion every 2 seconds I don't think I can explain better than by quoting from the manual (for the= =20 full details see the WAL implementation and configuration sections): "The number of 16MB segment files will always be at least WAL_FILES + 1, an= d=20 will normally not exceed WAL_FILES + MAX(WAL_FILES, CHECKPOINT_SEGMENTS) + = 1.=20 This may be used to estimate space requirements for WAL. Ordinarily, when a= n=20 old log segment files are no longer needed, they are recycled (renamed to= =20 become the next sequential future segments). If, due to a short-term peak o= f=20 log output rate, there are more than WAL_FILES + MAX(WAL_FILES,=20 CHECKPOINT_SEGMENTS) + 1 segment files, then unneeded segment files will be= =20 deleted instead of recycled until the system gets back under this limit. (I= f=20 this happens on a regular basis, WAL_FILES should be increased to avoid it.= =20 Deleting log segments that will only have to be created again later is=20 expensive and pointless.) " Given a wal_files setting of 64 you're always going to have 65 files. Keep = an=20 eye on it and see if the number of files keeps increasing - if not, you don= 't=20 have a problem. If you want to reduce the number of files, reduce wal_files. --=20 Richard Huxton