pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Masahiro Ikeda <ikedamsh@oss.nttdata.com>
To: kuroda.hayato@fujitsu.com
Cc: japin <japinli@hotmail.com>
Cc: Masahiko Sawada <sawada.mshk@gmail.com>
Cc: PostgreSQL-development <pgsql-hackers@postgresql.org>
Subject: RE: About to add WAL write/fsync statistics to pg_stat_wal view
Date: Mon, 25 Jan 2021 12:53:05 +0900
Message-ID: <b0a86f34c9580bf418419b515f11769a@oss.nttdata.com> (raw)
In-Reply-To: <OSBPR01MB315762ADE2AE7B871C356235F5BD0@OSBPR01MB3157.jpnprd01.prod.outlook.com>
References: <0509ad67b585a5b86a83d445dfa75392@oss.nttdata.com>
	<BC7530CF-3730-4E4C-A843-3B9F514786C3@hotmail.com>
	<65e99b78066ab1e3dc82a4e6f5e6f3cd@oss.nttdata.com>
	<7aef8ee6eea05a38ca91580caa5b2f07@oss.nttdata.com>
	<CAD21AoB=RCYME3+iroY+8TrC9tsHTPo7kRKCpU7C_kZ8kgGW2A@mail.gmail.com>
	<8555ab589d74ec2df61237209f4f21f2@oss.nttdata.com>
	<MEYP282MB1669B25B065F504ACB6C06E0B6A00@MEYP282MB1669.AUSP282.PROD.OUTLOOK.COM>
	<459df7fb095af8d2398ed633c1e9999a@oss.nttdata.com>
	<OSBPR01MB315762ADE2AE7B871C356235F5BD0@OSBPR01MB3157.jpnprd01.prod.outlook.com>

On 2021-01-25 10:34, kuroda.hayato@fujitsu.com wrote:
> Dear Ikeda-san,
> 
> Thank you for updating the patch. This can be applied to master, and
> can be used on my RHEL7.
> wal_write_time and wal_sync_time increase normally :-).
> 
> ```
> postgres=# select * from pg_stat_wal;
> -[ RECORD 1 ]----+------------------------------
> wal_records      | 121781
> wal_fpi          | 2287
> wal_bytes        | 36055146
> wal_buffers_full | 799
> wal_write        | 12770
> wal_write_time   | 4.469
> wal_sync         | 11962
> wal_sync_time    | 132.352
> stats_reset      | 2021-01-25 00:51:40.674412+00
> ```

Thanks for checking.

> I put a further comment:
> 
> ```
> @@ -3485,7 +3485,53 @@ SELECT pid, wait_event_type, wait_event FROM
> pg_stat_activity WHERE wait_event i
>         <structfield>wal_buffers_full</structfield> <type>bigint</type>
>        </para>
>        <para>
> -       Number of times WAL data was written to disk because WAL
> buffers became full
> +       Total number of times WAL data was written to disk because WAL
> buffers became full
> +      </para></entry>
> +     </row>
> +
> +     <row>
> +      <entry role="catalog_table_entry"><para 
> role="column_definition">
> +       <structfield>wal_write</structfield> <type>bigint</type>
> +      </para>
> +      <para>
> +       Total number of times WAL data was written to disk
> +      </para></entry>
> +     </row>
> +
> +     <row>
> +      <entry role="catalog_table_entry"><para 
> role="column_definition">
> +       <structfield>wal_write_time</structfield> <type>double 
> precision</type>
> +      </para>
> +      <para>
> +       Total amount of time that has been spent in the portion of
> +       WAL data was written to disk, in milliseconds
> +       (if <xref linkend="guc-track-wal-io-timing"/> is enabled,
> otherwise zero).
> +      </para></entry>
> +     </row>
> +
> +     <row>
> +      <entry role="catalog_table_entry"><para 
> role="column_definition">
> +       <structfield>wal_sync</structfield> <type>bigint</type>
> +      </para>
> +      <para>
> +       Total number of times WAL data was synced to disk
> +       (if <xref linkend="guc-wal-sync-method"/> is
> <literal>open_datasync</literal> or
> +       <literal>open_sync</literal>, this value is zero because WAL
> data is synced
> +       when to write it).
> +      </para></entry>
> +     </row>
> +
> +     <row>
> +      <entry role="catalog_table_entry"><para 
> role="column_definition">
> +       <structfield>wal_sync_time</structfield> <type>double 
> precision</type>
> +      </para>
> +      <para>
> +       Total amount of time that has been spent in the portion of
> +       WAL data was synced to disk, in milliseconds
> +       (if <xref linkend="guc-track-wal-io-timing"/> is enabled,
> otherwise zero.
> +       if <xref linkend="guc-wal-sync-method"/> is
> <literal>open_datasync</literal> or
> +       <literal>open_sync</literal>, this value is zero too because
> WAL data is synced
> +       when to write it).
>        </para></entry>
>       </row>
>  ```
> 
> Maybe "Total amount of time" should be used, not "Total number of 
> time."
> Other views use "amount."

Thanks.

I checked columns' descriptions of other views.
There are "Number of xxx", "Total number of xxx", "Total amount of time 
that xxx" and "Total time spent xxx".

Since the "time" is used for showing spending time, not count,
I'll change it to "Total number of WAL data written/synced to disk".
Thought?

Regards,
-- 
Masahiro Ikeda
NTT DATA CORPORATION





view thread (67+ messages)  latest in thread

Message-ID: <b0a86f34c9580bf418419b515f11769a@oss.nttdata.com>
Permalink:  ../b0a86f34c9580bf418419b515f11769a@oss.nttdata.com/
Also on:    postgresql.org/message-id/b0a86f34c9580bf418419b515f11769a@oss.nttdata.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-hackers@postgresql.org
  Cc: ikedamsh@oss.nttdata.com, kuroda.hayato@fujitsu.com, japinli@hotmail.com, sawada.mshk@gmail.com
  Subject: Re: About to add WAL write/fsync statistics to pg_stat_wal view
  In-Reply-To: <b0a86f34c9580bf418419b515f11769a@oss.nttdata.com>
  References: <0509ad67b585a5b86a83d445dfa75392@oss.nttdata.com> <BC7530CF-3730-4E4C-A843-3B9F514786C3@hotmail.com> <65e99b78066ab1e3dc82a4e6f5e6f3cd@oss.nttdata.com> <7aef8ee6eea05a38ca91580caa5b2f07@oss.nttdata.com> <CAD21AoB=RCYME3+iroY+8TrC9tsHTPo7kRKCpU7C_kZ8kgGW2A@mail.gmail.com> <8555ab589d74ec2df61237209f4f21f2@oss.nttdata.com> <MEYP282MB1669B25B065F504ACB6C06E0B6A00@MEYP282MB1669.AUSP282.PROD.OUTLOOK.COM> <459df7fb095af8d2398ed633c1e9999a@oss.nttdata.com> <OSBPR01MB315762ADE2AE7B871C356235F5BD0@OSBPR01MB3157.jpnprd01.prod.outlook.com> <b0a86f34c9580bf418419b515f11769a@oss.nttdata.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox