Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1XtkXJ-0001OF-VY for pgsql-bugs@arkaria.postgresql.org; Wed, 26 Nov 2014 21:54:10 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1XtkXJ-0006Ru-9I for pgsql-bugs@arkaria.postgresql.org; Wed, 26 Nov 2014 21:54:09 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1XtkXI-0006Rl-6Z for pgsql-bugs@postgresql.org; Wed, 26 Nov 2014 21:54:08 +0000 Received: from smtp-out2.gransy.com ([77.78.126.49]) by makus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1XtkXA-0005vN-K8 for pgsql-bugs@postgresql.org; Wed, 26 Nov 2014 21:54:06 +0000 Received: from smtp-out.gransy.com (localhost [127.0.0.1]) by smtp-out2.gransy.com (Postfix) with ESMTP id 0FD9C3F0133 for ; Wed, 26 Nov 2014 22:54:03 +0100 (CET) Received: from smtp.gransy.com (smtp.simplia.cz [77.78.126.20]) by smtp-out2.gransy.com (Postfix) with ESMTP id A188A3F0120 for ; Wed, 26 Nov 2014 22:54:02 +0100 (CET) Received: from [192.168.1.163] (ip-78-45-139-138.net.upcbroadband.cz [78.45.139.138]) (Authenticated sender: tv@fuzzy.cz) by smtp.gransy.com (Postfix) with ESMTPSA id 965DF19A0456 for ; Wed, 26 Nov 2014 22:53:53 +0100 (CET) Message-ID: <54764BF6.20605@fuzzy.cz> Date: Wed, 26 Nov 2014 22:53:58 +0100 From: Tomas Vondra User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0 MIME-Version: 1.0 To: pgsql-bugs@postgresql.org Subject: Re: BUG #12071: Stat collector went crasy (50MB/s constant writes) References: <20141126130810.15507.39189@wrigleys.postgresql.org> <54763BD8.8020906@fuzzy.cz> In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org 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