Re: Redesigning checkpoint_segments

Поиск
Список
Период
Сортировка
От Heikki Linnakangas
Тема Re: Redesigning checkpoint_segments
Дата
Msg-id 54D3E3D9.4010404@vmware.com
обсуждение исходный текст
Ответ на Re: Redesigning checkpoint_segments  (Robert Haas <robertmhaas@gmail.com>)
Ответы Re: Redesigning checkpoint_segments  (Robert Haas <robertmhaas@gmail.com>)
Список pgsql-hackers
On 02/05/2015 11:28 PM, Robert Haas wrote:
> On Thu, Feb 5, 2015 at 2:11 PM, Josh Berkus <josh@agliodbs.com> wrote:
>> Default of 4 for min_wal_size?
>
> I assume you mean 4 segments; why not 3 as currently?  As long as the
> system has the latitude to ratchet it up when needed, there seems to
> be little advantage to raising the minimum.  Of course I guess there
> must be some advantage or Heikki wouldn't have made it configurable,
> but I'd err on the side of keeping this one small.  Hopefully the
> system that automatically adjusts this is really smart, and a large
> min_wal_size is superfluous for most people.

There are a few reasons for making the minimum configurable:

1. Creating new segments when you need them is not free, so if you have 
a workload with occasional very large spikes, you might want to prepare 
for them. The auto-tuning will accommodate for the peak usage, but it's 
a moving average so if the peaks are infrequent enough, it will shrink 
the size down between the spikes.

2. To avoid running out of disk space on write to WAL (which leads to a 
PANIC). In particular, if you have the WAL on the same filesystem as the 
data, pre-reserving all the space required for WAL makes it much more 
likely that you when you run out of disk space, you run out when writing 
regular data, not WAL.

3. Unforeseen issues with the auto-tuning. It might not suite everyone, 
so it's nice that you can still get the old behaviour by setting min=max.

Actually, perhaps we should have a boolean setting that just implies 
min=max, instead of having a configurable minimum?. That would cover all 
of those reasons pretty well. So we would have a "max_wal_size" setting, 
and a boolean "preallocate_all_wal = on | off". Would anyone care for 
the flexibility of setting a minimum that's different from the maximum?

- Heikki




В списке pgsql-hackers по дате отправления:

Предыдущее
От: Josh Berkus
Дата:
Сообщение: Re: Redesigning checkpoint_segments
Следующее
От: Robert Haas
Дата:
Сообщение: Re: Redesigning checkpoint_segments