Re: Write-heavy pg_stats_collector on mostly idle server

From: Cédric Villemain <cedric(dot)villemain(dot)debian(at)gmail(dot)com>
To: jd(at)commandprompt(dot)com
Cc: Josh Berkus <josh(at)agliodbs(dot)com>, pgsql-performance(at)postgresql(dot)org
Subject: Re: Write-heavy pg_stats_collector on mostly idle server
Date: 2011-02-07 23:24:37
Message-ID: AANLkTin5T+KartVKBjYRJuCNDEcTUAJkMW6Zna6uJi1Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

2011/2/8 Joshua D. Drake <jd(at)commandprompt(dot)com>:
> On Mon, 2011-02-07 at 14:58 -0800, Josh Berkus wrote:
>> >> Anyone seen anything like this before?
>> >>
>> >
>> > it is the expected behavior, IIRC
>>
>> OK.  It just seems kind of pathological for stats file writing to be 10X
>> the volume of data writing.  I see why it's happening, but I think it's
>> something we should fix.
>
> I don't think it is expected. As I recall, it is something we fixed a
> couple of major versions back (8.2?). It used to be that stats would
> write every 500ms. We changed that to when they are asked for (via a
> select from the table or something). Specifically because it could cause
> this type of problem.
>
> Am I thinking of something else?
>
> I remember going back and forth with tgl about this, tgl?

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);

>
> JD
>
>>
>> --
>>                                   -- Josh Berkus
>>                                      PostgreSQL Experts Inc.
>>                                      http://www.pgexperts.com
>>
>
> --
> PostgreSQL.org Major Contributor
> Command Prompt, Inc: http://www.commandprompt.com/ - 509.416.6579
> Consulting, Training, Support, Custom Development, Engineering
> http://twitter.com/cmdpromptinc | http://identi.ca/commandprompt
>
>

--
Cédric Villemain               2ndQuadrant
http://2ndQuadrant.fr/     PostgreSQL : Expertise, Formation et Support

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Craig Ringer 2011-02-07 23:49:27 Re: Really really slow select count(*)
Previous Message Joshua D. Drake 2011-02-07 23:12:36 Re: Write-heavy pg_stats_collector on mostly idle server