Almost full pg_xlog/

Lists: pgsql-general
From: Jeff Ross <jross(at)wykids(dot)org>
To: pgsql-general(at)postgresql(dot)org
Subject: Almost full pg_xlog/
Date: 2011-01-31 23:32:16
Message-ID: 4D474698.8070609@wykids.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

Hi,

I started trying to setup streaming replication here at work the first
of December but I didn't actually succeed until today. Too many other
crises to attend to ;-)

In the meantime, I now have 242 16MB files in pg_xlog/. The
archive_status directory in pg_xlog/has a matching .done file for all
but the most recent of those pg_xlog files.

Am I correct in thinking that I can delete most if not all of the
pg_xlog/ files that have a matching .done entry in
pg_xlog/archive_status/ ? Or is there a better way?

Sorry in advance if this is in the docs somewhere--I haven't found it yet.

Thanks,

Jeff Ross


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Jeff Ross <jross(at)wykids(dot)org>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Almost full pg_xlog/
Date: 2011-02-01 00:14:01
Message-ID: 11241.1296519241@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

Jeff Ross <jross(at)wykids(dot)org> writes:
> In the meantime, I now have 242 16MB files in pg_xlog/. The
> archive_status directory in pg_xlog/has a matching .done file for all
> but the most recent of those pg_xlog files.

What have you got checkpoint_segments set to?

> Am I correct in thinking that I can delete most if not all of the
> pg_xlog/ files that have a matching .done entry in
> pg_xlog/archive_status/ ? Or is there a better way?

The system should be removing them for itself once there are too many.
Trying to remove them manually is a good recipe for creating trouble.

regards, tom lane


From: Jeff Ross <jross(at)wykids(dot)org>
To:
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Almost full pg_xlog/
Date: 2011-02-01 00:28:16
Message-ID: 4D4753B8.7080508@wykids.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

On 01/31/11 17:13, Tom Lane wrote:
> Jeff Ross<jross(at)wykids(dot)org> writes:
>> In the meantime, I now have 242 16MB files in pg_xlog/. The
>> archive_status directory in pg_xlog/has a matching .done file for all
>> but the most recent of those pg_xlog files.
>
> What have you got checkpoint_segments set to?
>

I had wal_keep_segments *way* too high. I wanted 30 but somehow ended
up with 300.

Here are the rest of my settings in case I missed something else:

#my settings
listen_addresses = 'localhost,10.31.16.2'
unix_socket_directory = '/var/postgresql/'
log_line_prefix = '<%u%%%d> '
log_statement = 'all'
archive_mode = on
wal_level = hot_standby hot_standby
archive_command = '/etc/scripts/wal_archive.sh %p %f'
default_statistics_target = 50 # pgtune wizard 2009-12-19
maintenance_work_mem = 120MB # pgtune wizard 2009-12-19
constraint_exclusion = on # pgtune wizard 2009-12-19
checkpoint_completion_target = 0.9 # pgtune wizard 2009-12-19
effective_cache_size = 1408MB # pgtune wizard 2009-12-19
work_mem = 12MB # pgtune wizard 2009-12-19
wal_buffers = 8MB # pgtune wizard 2009-12-19
checkpoint_segments = 16 # pgtune wizard 2009-12-19
shared_buffers = 480MB # pgtune wizard 2009-12-19
max_connections = 80 # pgtune wizard 2009-12-19
max_wal_senders = 3 # max number of walsender processes
wal_keep_segments = 300

Thanks, Tom!

Jeff

>> Am I correct in thinking that I can delete most if not all of the
>> pg_xlog/ files that have a matching .done entry in
>> pg_xlog/archive_status/ ? Or is there a better way?
>
> The system should be removing them for itself once there are too many.
> Trying to remove them manually is a good recipe for creating trouble.
>
> regards, tom lane
>


From: Adrian Klaver <adrian(dot)klaver(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Cc: Jeff Ross <jross(at)wykids(dot)org>
Subject: Re: Almost full pg_xlog/
Date: 2011-02-01 00:30:58
Message-ID: 201101311630.58762.adrian.klaver@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

On Monday, January 31, 2011 3:32:16 pm Jeff Ross wrote:
> Hi,
>
> I started trying to setup streaming replication here at work the first
> of December but I didn't actually succeed until today. Too many other
> crises to attend to ;-)
>
> In the meantime, I now have 242 16MB files in pg_xlog/. The
> archive_status directory in pg_xlog/has a matching .done file for all
> but the most recent of those pg_xlog files.
>
> Am I correct in thinking that I can delete most if not all of the
> pg_xlog/ files that have a matching .done entry in
> pg_xlog/archive_status/ ? Or is there a better way?
>
> Sorry in advance if this is in the docs somewhere--I haven't found it yet.
>
> Thanks,
>
> Jeff Ross

What do you have wal_keep_segments set to in postgresql.conf?

See here for more detail:
http://www.postgresql.org/docs/9.0/interactive/runtime-config-wal.html#RUNTIME-
CONFIG-REPLICATION

--
Adrian Klaver
adrian(dot)klaver(at)gmail(dot)com