pgsql: Reduce idle power consumption of walwriter and checkpointer proc

Поиск
Список
Период
Сортировка
От Tom Lane
Тема pgsql: Reduce idle power consumption of walwriter and checkpointer proc
Дата
Msg-id E1SRuNn-0001Xe-4K@gemulon.postgresql.org
обсуждение исходный текст
Список pgsql-committers
Reduce idle power consumption of walwriter and checkpointer processes.

This patch modifies the walwriter process so that, when it has not found
anything useful to do for many consecutive wakeup cycles, it extends its
sleep time to reduce the server's idle power consumption.  It reverts to
normal as soon as it's done any successful flushes.  It's still true that
during any async commit, backends check for completed, unflushed pages of
WAL and signal the walwriter if there are any; so that in practice the
walwriter can get awakened and returned to normal operation sooner than the
sleep time might suggest.

Also, improve the checkpointer so that it uses a latch and a computed delay
time to not wake up at all except when it has something to do, replacing a
previous hardcoded 0.5 sec wakeup cycle.  This also is primarily useful for
reducing the server's power consumption when idle.

In passing, get rid of the dedicated latch for signaling the walwriter in
favor of using its procLatch, since that comports better with possible
generic signal handlers using that latch.  Also, fix a pre-existing bug
with failure to save/restore errno in walwriter's signal handlers.

Peter Geoghegan, somewhat simplified by Tom

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/5461564a9dfd73f12a21f2aff5d7b3678c7afc25

Modified Files
--------------
src/backend/access/transam/xlog.c     |   38 +++++-------
src/backend/postmaster/checkpointer.c |  109 ++++++++++++++++++++++++++------
src/backend/postmaster/walwriter.c    |   80 +++++++++++++++++++++---
src/backend/storage/lmgr/proc.c       |    2 +
src/include/access/xlog.h             |    4 +-
src/include/storage/latch.h           |    9 +++
src/include/storage/proc.h            |    6 ++-
7 files changed, 189 insertions(+), 59 deletions(-)


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

Предыдущее
От: Peter Eisentraut
Дата:
Сообщение: pgsql: Tweak contrib --help output to match common style
Следующее
От: Tom Lane
Дата:
Сообщение: pgsql: Reduce idle power consumption of stats collector process.