Re: Redesigning checkpoint_segments

From: Josh Berkus <josh(at)agliodbs(dot)com>
To: Heikki Linnakangas <hlinnakangas(at)vmware(dot)com>
Cc: Peter Eisentraut <peter_e(at)gmx(dot)net>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Redesigning checkpoint_segments
Date: 2015-01-04 21:44:06
Message-ID: 54A9B426.7080501@agliodbs.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 01/03/2015 12:56 AM, Heikki Linnakangas wrote:
> On 01/03/2015 12:28 AM, Josh Berkus wrote:
>> On 01/02/2015 01:57 AM, Heikki Linnakangas wrote:
>>> wal_keep_segments does not affect the calculation of CheckPointSegments.
>>> If you set wal_keep_segments high enough, checkpoint_wal_size will be
>>> exceeded. The other alternative would be to force a checkpoint earlier,
>>> i.e. lower CheckPointSegments, so that checkpoint_wal_size would be
>>> honored. However, if you set wal_keep_segments high enough, higher than
>>> checkpoint_wal_size, it's impossible to honor checkpoint_wal_size no
>>> matter how frequently you checkpoint.
>>
>> So you're saying that wal_keep_segments is part of the max_wal_size
>> total, NOT in addition to it?
>
> Not sure what you mean. wal_keep_segments is an extra control that can
> prevent WAL segments from being recycled. It has the same effect as
> archive_command failing for N most recent segments, if that helps.

I mean, if I have these settings:

max_wal_size* = 256MB
wal_keep_segments = 8

... then my max wal size is *still* 256MB, NOT 384MB?

If that's the case (and I think it's a good plan), then as a follow-on,
we should prevent users from setting wal_keep_segments to more than 50%
of max_wal_size, no?

(* max_wal_size == checkpoint_wal_size, per prior email)

--
Josh Berkus
PostgreSQL Experts Inc.
http://pgexperts.com

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Fabrízio de Royes Mello 2015-01-04 23:17:45 Re: event trigger test exception message
Previous Message Andres Freund 2015-01-04 20:54:40 Re: Something is broken in logical decoding with CLOBBER_CACHE_ALWAYS