Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id 88FA81337B83 for ; Mon, 7 Feb 2011 21:39:59 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 61117-06 for ; Tue, 8 Feb 2011 01:39:52 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from outmail148152.authsmtp.com (outmail148152.authsmtp.com [62.13.148.152]) by mail.postgresql.org (Postfix) with ESMTP id 2D03D1337B34 for ; Mon, 7 Feb 2011 21:39:51 -0400 (AST) Received: from mail-c193.authsmtp.com (mail-c193.authsmtp.com [62.13.128.118]) by punt9.authsmtp.com (8.14.2/8.14.2/Kp) with ESMTP id p181dmlw090984; Tue, 8 Feb 2011 01:39:48 GMT Received: from Sidney-Stratton.local (dsl081-245-111.sfo1.dsl.speakeasy.net [64.81.245.111]) (authenticated bits=0) by mail.authsmtp.com (8.14.2/8.14.2) with ESMTP id p181djck094474; Tue, 8 Feb 2011 01:39:46 GMT Message-ID: <4D509EE1.4070305@agliodbs.com> Date: Mon, 07 Feb 2011 17:39:45 -0800 From: Josh Berkus User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.1b3pre) Gecko/20090223 Thunderbird/3.0b2 MIME-Version: 1.0 To: =?UTF-8?B?Q8OpZHJpYyBWaWxsZW1haW4=?= CC: jd@commandprompt.com, pgsql-performance@postgresql.org Subject: Re: Write-heavy pg_stats_collector on mostly idle server References: <4D4C4E15.20401@agliodbs.com> <4D507920.2030909@agliodbs.com> <1297120356.18411.197.camel@jd-desktop> In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Server-Quench: 503179e4-3324-11e0-97bb-002264978518 X-AuthReport-Spam: If SPAM / abuse - report it at: http://www.authsmtp.com/abuse X-AuthRoute: OCdyZgscClZXSx8a IioLCC5HRQ8+YBZL BAkGMA9GIUINWEQK c1ACfh19PVdbHwkA AnYLWl5XWVd1Xi1z bxRZbBtfZk9QXgRr T0pMQFdNFEsoABQA UkRNCRl7cwFBfDB1 ZkRqEHVbX0V9fBN5 X01XF2kbZGY1aH0W VxIKagNUcgFMehZC YlV+XD1vNG8XDRoV JSEUBRUEdQpFKThY BwEAJEwDCV4EKSUg TgwZKj4oGUkITDk0 NVQhLBYZG10NNlR6 MFclVBoDPgUMBxc2 X-Authentic-SMTP: 61633136333939.1014:706 X-AuthFastPath: 0 (Was 255) X-AuthVirus-Status: No virus detected - but ensure you scan with your own anti-virus system. X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.9 tagged_above=-10 required=5 tests=BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001 X-Spam-Level: X-Archive-Number: 201102/295 X-Sequence-Number: 42433 > Ooops. > It looks like you are right, see ./src/backend/postmaster/pgstat.c > > 3c2313f4 (Tom Lane 2008-11-03 01:17:08 +0000 2926) > if (last_statwrite < last_statrequest) > 70d75697 (Magnus Hagander 2008-08-05 12:09:30 +0000 2927) > pgstat_write_statsfile(false); This is a different issue. This is happening because we have a bunch of databases (25 to 35) and as a result autovacuum is requesting the stats file rather frequently. And autovacuum for whatever reason won't accept a stats file more than 10ms old, so it pretty much rewrites the stats file on every request. At least, that's my reading of it after poking around and talking to Gierth. It seems like that 10ms window for autovac is way too small. -- -- Josh Berkus PostgreSQL Experts Inc. http://www.pgexperts.com