Re: New statistics for WAL buffer dirty writes - Mailing list pgsql-hackers

From Satoshi Nagayasu
Subject Re: New statistics for WAL buffer dirty writes
Date
Msg-id 508DFEC9.4020102@uptime.jp
Whole thread Raw
In response to Re: New statistics for WAL buffer dirty writes  (Alvaro Herrera <alvherre@2ndquadrant.com>)
Responses Re: New statistics for WAL buffer dirty writes  (Alvaro Herrera <alvherre@2ndquadrant.com>)
Re: New statistics for WAL buffer dirty writes  (Tomas Vondra <tv@fuzzy.cz>)
List pgsql-hackers
2012/10/24 1:12, Alvaro Herrera wrote:
> Satoshi Nagayasu escribió:
>
>> With this patch, walwriter process and each backend process
>> would sum up dirty writes, and send it to the stat collector.
>> So, the value could be saved in the stat file, and could be
>> kept on restarting.
>>
>> The statistics could be retreive with using
>> pg_stat_get_xlog_dirty_writes() function, and could be reset
>> with calling pg_stat_reset_shared('walwriter').
>>
>> Now, I have one concern.
>>
>> The reset time could be captured in globalStats.stat_reset_timestamp,
>> but this value is the same with the bgwriter one.
>>
>> So, once pg_stat_reset_shared('walwriter') is called,
>> stats_reset column in pg_stat_bgwriter does represent
>> the reset time for walwriter, not for bgwriter.
>>
>> How should we handle this?  Should we split this value?
>> And should we have new system view for walwriter?
>
> I think the answer to the two last questions is yes.  It doesn't seem to
> make sense, to me, to have a single reset timings for what are
> effectively two separate things.
>
> Please submit an updated patch to next CF.  I'm marking this one
> returned with feedback.  Thanks.
>

I attached the latest one, which splits the reset_time
for bgwriter and walwriter, and provides new system view,
called pg_stat_walwriter, to show the dirty write counter
and the reset time.

Regards,
--
Satoshi Nagayasu <snaga@uptime.jp>
Uptime Technologies, LLC. http://www.uptime.jp

Attachment

pgsql-hackers by date:

Previous
From: Jan Wieck
Date:
Subject: Re: Logical to physical page mapping
Next
From: Robert Haas
Date:
Subject: Re: Logical to physical page mapping