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

From: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
To: FattahRozzaq <ssoorruu(at)gmail(dot)com>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: HELP!!! The WAL Archive is taking up all space
Date: 2015-12-08 23:41:28
Message-ID: CAB7nPqQ5TYa3jq0vY8XCnpehbCWWTQGn3zEmEGgufYoGQMxRrQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Dec 8, 2015 at 7:33 PM, FattahRozzaq <ssoorruu(at)gmail(dot)com> wrote:
> The WAL archive is at /home/postgres/archive/master/, right?
> This directory consume more than 750GB of Disk-1.
> Each segment in the /home/postgres/archive/master/ is 16MB each
> There are currently 47443 files in this folder.
>
> I want to limit the total size use by WAL archive to around 200-400 GB.

This kind of question is more adapted for pgsql-general. pgsql-hackers
is where happens discussions related to features and development.

There is no magic value. This depends on the data policy retention you
want to have for your backups. More information here:
http://www.postgresql.org/docs/devel/static/continuous-archiving.html
If you don't need this many segments, you should just decrease it. If
you need more, buy more disk space.

> Do I set the segment too big?
> wal_keep_segments = 4096
> What value should I set for it?

That's a lot, but it depends on what you seek, leading to up to 200GB
of WAL segments. Here this would be useful if you expect to be able to
recover with large instances, aka a base backup takes a lot of time,
and the standby that replays behind will be able to connect to its
root note within this interval of segments.
--
Michael

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message David G. Johnston 2015-12-08 23:43:02 Re: HELP!!! The WAL Archive is taking up all space
Previous Message Thom Brown 2015-12-08 23:40:43 Re: Double linking MemoryContext children