pg_xlog keeps growing

Started by dhanuj hippieabout 9 years ago7 messagesgeneral
Jump to latest
#1dhanuj hippie
dhanuj.hippie@gmail.com

Hi,

I have a postgres cluster running in hot_standby. I see the pg_xlog is
growing over time (may files of size 16 MB each). The replication lag is
very less ~2kB, and never goes into a bad state.
I'm manually resetting this once a while using pg_resetxlog command.
Is there a way to understand why my system keeps running into this problem ?

Thanks

#2Rob Sargent
robjsargent@gmail.com
In reply to: dhanuj hippie (#1)
Re: pg_xlog keeps growing

On Feb 27, 2017, at 8:33 PM, dhanuj hippie <dhanuj.hippie@gmail.com> wrote:

Hi,

I have a postgres cluster running in hot_standby. I see the pg_xlog is growing over time (may files of size 16 MB each). The replication lag is very less ~2kB, and never goes into a bad state.
I'm manually resetting this once a while using pg_resetxlog command.
Is there a way to understand why my system keeps running into this problem ?

Thanks

wal_keep_segments is set to ???

(and version = ???, etc)

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

#3dhanuj hippie
dhanuj.hippie@gmail.com
In reply to: Rob Sargent (#2)
Re: pg_xlog keeps growing

psql (9.3.5)
wal_keep_segments = 1024

On Tue, Feb 28, 2017 at 9:16 AM, Rob Sargent <robjsargent@gmail.com> wrote:

Show quoted text

On Feb 27, 2017, at 8:33 PM, dhanuj hippie <dhanuj.hippie@gmail.com>

wrote:

Hi,

I have a postgres cluster running in hot_standby. I see the pg_xlog is

growing over time (may files of size 16 MB each). The replication lag is
very less ~2kB, and never goes into a bad state.

I'm manually resetting this once a while using pg_resetxlog command.
Is there a way to understand why my system keeps running into this

problem ?

Thanks

wal_keep_segments is set to ???

(and version = ???, etc)

#4dhanuj hippie
dhanuj.hippie@gmail.com
In reply to: dhanuj hippie (#3)
Re: pg_xlog keeps growing

So does it work like - it can go upto 16MB*1024 times which is 16GB, and
then this will be cleaned up automatically ?

On Tue, Feb 28, 2017 at 9:47 AM, dhanuj hippie <dhanuj.hippie@gmail.com>
wrote:

Show quoted text

psql (9.3.5)
wal_keep_segments = 1024

On Tue, Feb 28, 2017 at 9:16 AM, Rob Sargent <robjsargent@gmail.com>
wrote:

On Feb 27, 2017, at 8:33 PM, dhanuj hippie <dhanuj.hippie@gmail.com>

wrote:

Hi,

I have a postgres cluster running in hot_standby. I see the pg_xlog is

growing over time (may files of size 16 MB each). The replication lag is
very less ~2kB, and never goes into a bad state.

I'm manually resetting this once a while using pg_resetxlog command.
Is there a way to understand why my system keeps running into this

problem ?

Thanks

wal_keep_segments is set to ???

(and version = ???, etc)

#5Michael Paquier
michael@paquier.xyz
In reply to: dhanuj hippie (#4)
Re: pg_xlog keeps growing

On Tue, Feb 28, 2017 at 1:20 PM, dhanuj hippie <dhanuj.hippie@gmail.com> wrote:

So does it work like - it can go upto 16MB*1024 times which is 16GB, and
then this will be cleaned up automatically ?

On a standby each time a restart point is created the oldest segments
are either recycled or removed, wal_keep_segments retains more of
that. You can look at KeepLogSeg() in
src/backend/access/transam/xlog.c if you want..
--
Michael

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

#6dhanuj hippie
dhanuj.hippie@gmail.com
In reply to: Michael Paquier (#5)
Re: pg_xlog keeps growing

Based on my config, what is the max size this directory is expected to grow
? And how can I check whether this recycle/removal is happening fine ?

On Tue, Feb 28, 2017 at 10:08 AM, Michael Paquier <michael.paquier@gmail.com

Show quoted text

wrote:

On Tue, Feb 28, 2017 at 1:20 PM, dhanuj hippie <dhanuj.hippie@gmail.com>
wrote:

So does it work like - it can go upto 16MB*1024 times which is 16GB, and
then this will be cleaned up automatically ?

On a standby each time a restart point is created the oldest segments
are either recycled or removed, wal_keep_segments retains more of
that. You can look at KeepLogSeg() in
src/backend/access/transam/xlog.c if you want..
--
Michael

#7David G. Johnston
david.g.johnston@gmail.com
In reply to: dhanuj hippie (#4)
Re: pg_xlog keeps growing

On Monday, February 27, 2017, dhanuj hippie <dhanuj.hippie@gmail.com> wrote:

So does it work like - it can go upto 16MB*1024 times which is 16GB, and
then this will be cleaned up automatically ?

On Tue, Feb 28, 2017 at 9:47 AM, dhanuj hippie <dhanuj.hippie@gmail.com
<javascript:_e(%7B%7D,'cvml','dhanuj.hippie@gmail.com');>> wrote:

psql (9.3.5)
wal_keep_segments = 1024

https://www.postgresql.org/docs/9.3/static/wal-configuration.html

David J.