Re: HELP!!! The WAL Archive is taking up all space

From: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
To: Alan Hodgson <ahodgson(at)simkin(dot)ca>, pgsql-general(at)postgresql(dot)org
Subject: Re: HELP!!! The WAL Archive is taking up all space
Date: 2015-12-09 19:22:29
Message-ID: 56687F75.8040203@aklaver.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 12/09/2015 11:15 AM, Alan Hodgson wrote:
> On Wednesday, December 09, 2015 07:55:09 AM FattahRozzaq wrote:
>> archive_mode = on
>> archive_command = 'cp -i %p /home/postgres/archive/master/%f'
>>
>>
>> The WAL archive folder is at /home/postgres/archive/master/, right?
>> This directory consumes around 750GB of Disk-1.
>> Each segment in the /home/postgres/archive/master/ is 16MB each
>> There are currently 47443 files in this folder.
>>
>> If I want to limit the total size use by WAL archive to around 200-400
>> GB, what value should I set for the wal_keep_segments,
>> checkpoint_segments?
>
> PostgreSQL doesn't clean up files copied by your archive_command. You need to
> have a separate task clean those out. PostgreSQL's active wal_keep_segments
> etc. are in the data/pg_xlog directory.
>

The OP might want to take a look at:

http://www.postgresql.org/docs/9.4/interactive/pgarchivecleanup.html

To be safe I would use:

-n

Print the names of the files that would have been removed on stdout
(performs a dry run).

at first.

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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message John R Pierce 2015-12-09 19:38:18 Re: HELP!!! The WAL Archive is taking up all space
Previous Message Alan Hodgson 2015-12-09 19:15:44 Re: HELP!!! The WAL Archive is taking up all space