pgsql: Checkpoint sorting and balancing.

Поиск
Список
Период
Сортировка
От Andres Freund
Тема pgsql: Checkpoint sorting and balancing.
Дата
Msg-id E1aeBt7-0005jP-Il@gemulon.postgresql.org
обсуждение исходный текст
Ответы Re: pgsql: Checkpoint sorting and balancing.  (Peter Eisentraut <peter_e@gmx.net>)
Re: pgsql: Checkpoint sorting and balancing.  (Michael Paquier <michael.paquier@gmail.com>)
Список pgsql-committers
Checkpoint sorting and balancing.

Up to now checkpoints were written in the order they're in the
BufferDescriptors. That's nearly random in a lot of cases, which
performs badly on rotating media, but even on SSDs it causes slowdowns.

To avoid that, sort checkpoints before writing them out. We currently
sort by tablespace, relfilenode, fork and block number.

One of the major reasons that previously wasn't done, was fear of
imbalance between tablespaces. To address that balance writes between
tablespaces.

The other prime concern was that the relatively large allocation to sort
the buffers in might fail, preventing checkpoints from happening. Thus
pre-allocate the required memory in shared memory, at server startup.

This particularly makes it more efficient to have checkpoint flushing
enabled, because that'll often result in a lot of writes that can be
coalesced into one flush.

Discussion: alpine.DEB.2.10.1506011320000.28433@sto
Author: Fabien Coelho and Andres Freund

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/9cd00c457e6a1ebb984167ac556a9961812a683c

Modified Files
--------------
src/backend/storage/buffer/README     |   5 -
src/backend/storage/buffer/buf_init.c |  22 ++-
src/backend/storage/buffer/bufmgr.c   | 274 +++++++++++++++++++++++++++++-----
src/include/storage/buf_internals.h   |  18 +++
src/tools/pgindent/typedefs.list      |   2 +
5 files changed, 277 insertions(+), 44 deletions(-)


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

Предыдущее
От: Andres Freund
Дата:
Сообщение: pgsql: Allow to trigger kernel writeback after a configurable number of
Следующее
От: Peter Eisentraut
Дата:
Сообщение: Re: pgsql: Checkpoint sorting and balancing.