Re: Add statistics to pg_stat_wal view for wal related parameter tuning

From: Fujii Masao <masao(dot)fujii(at)oss(dot)nttdata(dot)com>
To: Masahiro Ikeda <ikedamsh(at)oss(dot)nttdata(dot)com>, lchch1990(at)sina(dot)cn
Cc: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Add statistics to pg_stat_wal view for wal related parameter tuning
Date: 2020-11-17 02:53:45
Message-ID: cca12983-1254-1c4d-316c-48d3d4508d4c@oss.nttdata.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2020/11/16 18:24, Masahiro Ikeda wrote:
> On 2020-11-13 12:32, lchch1990(at)sina(dot)cn wrote:
>>> Now, pg_stat_wal supports reset all informantion in WalStats
>>> using pg_stat_reset_shared('wal') function.
>>> Isn't it enough?
>> Yes it ok, sorry I miss this infomation.
>
> OK.
>
>>>> 3. I do not think it's a correct describe in document for
>>>> 'wal_buffers_full'.
>>
>>> Where should I rewrite the description? If my understanding is not
>>> correct, please let me know.
>> Sorry I have not described it clearly, because I can not understand
>> the meaning of this
>> column after I read the describe in document.
>> And now I read the source code of walwrite and found the place where
>> 'wal_buffers_full'
>> added is for a backend to wait a wal buffer which is occupied by other
>> wal page, so the
>> backend flush the old page in the wal buffer(after wait it can).
>> So i think the origin decribe in document is not so in point, we can
>> describe it such as
>> 'Total number of times WAL data written to the disk because a backend
>> yelled a wal buffer
>> for an advanced wal page.
>>
>> Sorry if my understand is wrong.
>
> Thanks for your comments.
>
> You're understanding is almost the same as mine.
> It describes when not only backends but also other backgrounds initialize a new wal page,
> wal buffer's space is already used and there is no space.
>
>> 'Total number of times WAL data written to the disk because a backend
>> yelled a wal buffer for an advanced wal page'
>
> Thanks for your suggestion.
> I wondered that users may confuse about how to use "wal_buffers_full" and how to tune parameters.
>
> I thought the reason which wal buffer has no space is
> important for users to tune the wal_buffers parameter.
>
> How about the following comments?
>
> 'Total number of times WAL data was written to the disk because WAL buffers got full
>  when to initialize a new WAL page'

Or what about the following?

Total number of times WAL data was written to the disk, to claim the buffer page to insert new WAL data when the WAL buffers got filled up with unwritten WAL data.

Regards,

--
Fujii Masao
Advanced Computing Technology Center
Research and Development Headquarters
NTT DATA CORPORATION

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message David G. Johnston 2020-11-17 02:53:59 Re: Terminate the idle sessions
Previous Message tsunakawa.takay@fujitsu.com 2020-11-17 02:49:17 RE: Disable WAL logging to speed up data loading