From: Niels Kristian Schjødt <nielskristian@autouncle.com>
To: postgres performance list <pgsql-performance@postgresql.org>
Subject: Why is my pg_xlog directory so huge?
Date: Mon, 18 Mar 2013 10:14:52 +0100
Message-ID: <02E032A0-7E7A-4CB3-9C76-5739B05660D5@autouncle.com> (raw)
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-performance>
After installing my new server I just discovered something that doesn't seem right:
sudo du -h /var/lib/postgresql/9.2/main
4.0K /var/lib/postgresql/9.2/main/pg_snapshots
4.0K /var/lib/postgresql/9.2/main/pg_serial
4.0K /var/lib/postgresql/9.2/main/pg_tblspc
29M /var/lib/postgresql/9.2/main/pg_clog
6.8G /var/lib/postgresql/9.2/main/pg_log
104K /var/lib/postgresql/9.2/main/pg_stat_tmp
81G /var/lib/postgresql/9.2/main/base/27132
6.1M /var/lib/postgresql/9.2/main/base/12040
4.0K /var/lib/postgresql/9.2/main/base/pgsql_tmp
6.0M /var/lib/postgresql/9.2/main/base/12035
6.0M /var/lib/postgresql/9.2/main/base/1
81G /var/lib/postgresql/9.2/main/base
80K /var/lib/postgresql/9.2/main/pg_multixact/members
108K /var/lib/postgresql/9.2/main/pg_multixact/offsets
192K /var/lib/postgresql/9.2/main/pg_multixact
12K /var/lib/postgresql/9.2/main/pg_notify
4.0K /var/lib/postgresql/9.2/main/pg_twophase
160K /var/lib/postgresql/9.2/main/pg_subtrans
752K /var/lib/postgresql/9.2/main/pg_xlog/archive_status
202G /var/lib/postgresql/9.2/main/pg_xlog
496K /var/lib/postgresql/9.2/main/global
289G /var/lib/postgresql/9.2/main
As you can see the pg_xlog folder is 202G, which is more than my entire database - this seems wrong to me, however I have no clue why this would happen.
In short, this is my postgresql.conf
data_directory = '/var/lib/postgresql/9.2/main' # use data in another directory
hba_file = '/etc/postgresql/9.2/main/pg_hba.conf' # host-based authentication file
ident_file = '/etc/postgresql/9.2/main/pg_ident.conf' # ident configuration file
external_pid_file = '/var/run/postgresql/9.2-main.pid' # write an extra PID file
listen_addresses = '192.168.0.4, localhost' # what IP address(es) to listen on;
port = 5432 # (change requires restart)
max_connections = 300 # (change requires restart)
unix_socket_directory = '/var/run/postgresql' # (change requires restart)
wal_level = hot_standby # minimal, archive, or hot_standby
synchronous_commit = on # synchronization level; on, off, or local
checkpoint_segments = 100 # in logfile segments, min 1, 16MB each
checkpoint_timeout = 10min # range 30s-1h
checkpoint_completion_target = 0.9 # checkpoint target duration, 0.0 - 1.0
archive_mode = on # allows archiving to be done
archive_command = 'rsync -a %p postgres@192.168.0.2:/var/lib/postgresql/9.2/wals/%f </dev/null' # command to use to archive a logfile segment
max_wal_senders = 1 # max number of walsender processes
wal_keep_segments = 32 # in logfile segments, 16MB each; 0 disables
hot_standby = on # "on" allows queries during recovery
log_line_prefix = '%t ' # special values:
datestyle = 'iso, mdy'
lc_messages = 'en_US.UTF-8' # locale for system error message
lc_monetary = 'en_US.UTF-8' # locale for monetary formatting
lc_numeric = 'en_US.UTF-8' # locale for number formatting
lc_time = 'en_US.UTF-8' # locale for time formatting
default_text_search_config = 'pg_catalog.english'
default_statistics_target = 100
maintenance_work_mem = 1GB
checkpoint_completion_target = 0.9
effective_cache_size = 22GB
work_mem = 160MB
wal_buffers = 4MB
shared_buffers = 4GB
--
Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-performance
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 from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-performance@postgresql.org
Cc: nielskristian@autouncle.com
Subject: Re: Why is my pg_xlog directory so huge?
In-Reply-To: <02E032A0-7E7A-4CB3-9C76-5739B05660D5@autouncle.com>
References: <02E032A0-7E7A-4CB3-9C76-5739B05660D5@autouncle.com>
* 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