pgsql: Reduce rate of walwriter wakeups due to async commits.

Поиск
Список
Период
Сортировка
От Heikki Linnakangas
Тема pgsql: Reduce rate of walwriter wakeups due to async commits.
Дата
Msg-id E1r7duP-007WNv-5r@gemulon.postgresql.org
обсуждение исходный текст
Список pgsql-committers
Reduce rate of walwriter wakeups due to async commits.

XLogSetAsyncXactLSN(), called at asynchronous commit, would wake up
walwriter every time the LSN advances, but walwriter doesn't actually
do anything unless it has at least 'wal_writer_flush_after' full
blocks of WAL to write. Repeatedly waking up walwriter to do nothing
is a waste of CPU cycles in both walwriter and the backends doing the
wakeups. To fix, apply the same logic in XLogSetAsyncXactLSN() to
decide whether to wake up walwriter, as walwriter uses to determine if
it has any work to do.

In the passing, rename misleadingly named 'flushbytes' local variable
to 'flushblocks'.

Author: Andres Freund, Heikki Linnakangas
Discussion: https://www.postgresql.org/message-id/20231024230929.vsc342baqs7kmbte@awork3.anarazel.de

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/1f395354d8742d57c166104874114b6e0d01e104

Modified Files
--------------
src/backend/access/transam/xlog.c | 49 +++++++++++++++++++++++++--------------
1 file changed, 31 insertions(+), 18 deletions(-)


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

Предыдущее
От: Amit Kapila
Дата:
Сообщение: pgsql: Avoid unconditionally filling in missing values with NULL in pgo
Следующее
От: Tomas Vondra
Дата:
Сообщение: pgsql: Check if ii_AmCache is NULL in aminsertcleanup