pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tomas Vondra <tv@fuzzy.cz>
To: pgsql-bugs@postgresql.org
Subject: Re: BUG #12071: Stat collector went crasy (50MB/s constant writes)
Date: Wed, 26 Nov 2014 22:53:58 +0100
Message-ID: <54764BF6.20605@fuzzy.cz> (raw)
In-Reply-To: <CAK-MWwSK5AUneiF5zyDvc_9pO4ZNTT_G45ZQG1AD+n55s2zzTg@mail.gmail.com>
References: <20141126130810.15507.39189@wrigleys.postgresql.org>
	<CAK-MWwSDmXTWCc3F2Wj3Zw6WZ_3JSKHaXFqZ2TDuq1jfKZOu=A@mail.gmail.com>
	<CAK-MWwQJF+EM5f_47r5wLpr6_2FBYNFeKKAD-DPP3JtzuAM15Q@mail.gmail.com>
	<CAK-MWwTmJV4VprhAfCyTKRLndYbwbToF-Z0JYv6_o=qq3VYxyQ@mail.gmail.com>
	<54763BD8.8020906@fuzzy.cz>
	<CAK-MWwTFTRVuBjLz_rJVNEompGj2btot88G5uwXW+d2DierSNQ@mail.gmail.com>
	<CAK-MWwSK5AUneiF5zyDvc_9pO4ZNTT_G45ZQG1AD+n55s2zzTg@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>

On 26.11.2014 22:36, Maxim Boguk wrote:
>>>So yes,  pgstat_send_inquiry definitely issued by autovacuum launcher.
>>>Now question why EVERY pgstat_send_inquiry request from autovacuum
> leads to the 1-2 full >>pgstat.stat rewrite on idle server?
> 
> Just another theory
> It happens exactly because the full idle server so no other activity
> which could provide some changes to pgstat.tmp file timestamp.
> 
> May be it could be good idea to update timestamp of pgstat.tmp file on
> every PgstatCollectorMain iteration if nothing had been received from
> stat socket?
> Or alternatively internally track the timestamp of the last update
> received from stat socket, and skip file rewrite step if nothing had
> been received since last full rewrite?

I'm not sure I understand what you mean.

The timestamp *IS* updated on every write - see this:

https://github.com/postgres/postgres/blob/REL9_2_STABLE/src/backend/postmaster/pgstat.c#L3469

Otherwise the difference between last_statwrite and last_statrequest
would grow indefinitely (and you're observing it's ~30ms every time).

Tomas


-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs



view thread (24+ messages)  latest in thread

Message-ID: <54764BF6.20605@fuzzy.cz>
Permalink:  ../54764BF6.20605@fuzzy.cz/
Also on:    postgresql.org/message-id/54764BF6.20605@fuzzy.cz

 · 

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-bugs@postgresql.org
  Cc: tv@fuzzy.cz
  Subject: Re: BUG #12071: Stat collector went crasy (50MB/s constant writes)
  In-Reply-To: <54764BF6.20605@fuzzy.cz>
  References: <20141126130810.15507.39189@wrigleys.postgresql.org> <CAK-MWwSDmXTWCc3F2Wj3Zw6WZ_3JSKHaXFqZ2TDuq1jfKZOu=A@mail.gmail.com> <CAK-MWwQJF+EM5f_47r5wLpr6_2FBYNFeKKAD-DPP3JtzuAM15Q@mail.gmail.com> <CAK-MWwTmJV4VprhAfCyTKRLndYbwbToF-Z0JYv6_o=qq3VYxyQ@mail.gmail.com> <54763BD8.8020906@fuzzy.cz> <CAK-MWwTFTRVuBjLz_rJVNEompGj2btot88G5uwXW+d2DierSNQ@mail.gmail.com> <CAK-MWwSK5AUneiF5zyDvc_9pO4ZNTT_G45ZQG1AD+n55s2zzTg@mail.gmail.com> <54764BF6.20605@fuzzy.cz>

* 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