Re: Monitoring time of fsyncing WALs

From: Konstantin Knizhnik <k(dot)knizhnik(at)postgrespro(dot)ru>
To: Robert Haas <robertmhaas(at)gmail(dot)com>, Michael Paquier <michael(at)paquier(dot)xyz>
Cc: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Monitoring time of fsyncing WALs
Date: 2018-06-29 13:26:34
Message-ID: 00844779-f139-1c52-0fd9-4806b2ebd1c2@postgrespro.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 29.06.2018 15:48, Robert Haas wrote:
> On Wed, Jun 27, 2018 at 10:27 PM, Michael Paquier <michael(at)paquier(dot)xyz> wrote:
>> On Wed, Jun 27, 2018 at 07:32:18PM +0300, Konstantin Knizhnik wrote:
>>> I wonder why we are monitoring time of writing to WAL, but not time of
>>> fsyncing WAL segments?
>>> Is there are principle reason for it or just because nobody added it yet?
>>> If so, please find very small patch which adding WAIT_EVENT_WAL_FSYNC event
>>> type.
>> Let's name it WAIT_EVENT_WAL_SYNC as it is more consistent with the
>> other wait events of the same type, and also list the wait event
>> alphabetically everywhere this is added. I have also reworded the
>> documentation to be more consistent.
>>
>>> Our engineers in PgPro complain me that there is no information about time
>>> spent in syncing WALs...
>>> Unfortunately Postgres still is not able to aggregate this statistic. But at
>>> least we have pg_wait_sampling extension for it:
>>> https://github.com/postgrespro/pg_wait_sampling
>> Complain justified. It is a bit too late for v11 I think though, so
>> let's wait for v12 to open for business, and then I'll apply the patch
>> at if there are no objections until then.
> Are there other instances of fsync() that also need to be covered?
>
Syncing database files is already monitored (in mdsync and FileFlush).
If we grep for pg_fsync occurrences in Postgres code, then the only
place where pgstat_report_wait_start is not called before is
issue_xlog_fsync in xlog.c

--

Konstantin Knizhnik
Postgres Professional: http://www.postgrespro.com
The Russian Postgres Company

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2018-06-29 13:35:43 Re: assert in nested SQL procedure call in current HEAD
Previous Message Magnus Hagander 2018-06-29 13:20:02 Re: Code of Conduct committee: call for volunteers