pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Alvaro Herrera <alvherre@commandprompt.com>
To: Duan Ligong <duanlg@nec-as.nec.com.cn>
Cc: pgsql-performance@postgresql.org
Subject: Re: control the number of clog files and xlog files
Date: Tue, 26 Aug 2008 21:56:44 -0400
Message-ID: <20080827015644.GW4920@alvh.no-ip.org> (raw)
In-Reply-To: <20080827085439.22A4.DUANLG@nec-as.nec.com.cn>
References: <20080827085439.22A4.DUANLG@nec-as.nec.com.cn>

Duan Ligong wrote:

> Would you like to be so kind as to answer the following questions:
> 
> - Is there any way to control the number of clog files and xlog files? 
> I encounter an issue that there are too many clog files under the 
> pg_clog/ directory which occupy more space than I can endure..

pg_clog files are controlled by tuple freezing, which is done by vacuum,
and it depends on the autovacuum_min_freeze_age parameter and
vacuum_freeze_min_age.  Please read

http://www.postgresql.org/docs/8.3/interactive/routine-vacuuming.html
and
http://www.postgresql.org/docs/8.3/interactive/runtime-config-client.html#GUC-VACUUM-FREEZE-MIN-AGE


> - What determines the number of clog files? what determines the 
> number of xlog files?

The number of xlog files will depend on checkpoints.  You need to
restrict checkpoint_segments to control this.  Note that this can have a
serious performance impact.

> -  I understand pg_xlog is used to record WAL. but what is pg_clog
> is used to? Is it used to record some meta-information on the xlog?

clog is the "commit log", i.e. it records transactions that have been
committed and those that have been aborted.  You cannot delete files
unless you want to corrupt your database.

> - What effect does Deleting the clog and xlogfiles bring about?
> Will it cause Postgresql abnormal stopping?

Your data will be corrupt.  It may continue to work for a while, and
suddenly stop working at a future time.

-- 
Alvaro Herrera                                http://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.



view thread (4+ messages)  latest in thread

Message-ID: <20080827015644.GW4920@alvh.no-ip.org>
Permalink:  ../20080827015644.GW4920@alvh.no-ip.org/
Also on:    postgresql.org/message-id/20080827015644.GW4920@alvh.no-ip.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: alvherre@commandprompt.com, duanlg@nec-as.nec.com.cn
  Subject: Re: control the number of clog files and xlog files
  In-Reply-To: <20080827015644.GW4920@alvh.no-ip.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox