Re: stats collector spins my disk up every 500ms (8.2.3)

Поиск
Список
Период
Сортировка
От Alvaro Herrera
Тема Re: stats collector spins my disk up every 500ms (8.2.3)
Дата
Msg-id 20070516204857.GK4582@alvh.no-ip.org
обсуждение исходный текст
Ответ на Re: stats collector spins my disk up every 500ms (8.2.3)  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-general
Tom Lane wrote:
> Alvaro Herrera <alvherre@commandprompt.com> writes:
> > Daniel Barlow wrote:
>
> >> Questions:
> >> 1) this is on a system with I believe to be quiescent - there is only
> >> one client open which is not doing anything.  Before I get more involved
> >> with this, can someone just confirm that pgstat will continue to update
> >> this file even when nothing is happening?  If not, then I guess
> >> something /is/ happening and I need to investigate what it is (advice on
> >> how to track it down is welcome - I already have statement logging on,
> >> and there's nothing showing in there)
>
> > Hmm, I don't think we have an optimization to avoid writing it when the
> > data hasn't changed.  This seems easy to do ... see attached patch
> > (untested)
>
> Have you made any effort to confirm this is needed?  Watching the
> collector with strace, I don't see it doing anything but poll() unless
> new messages come in.

Hmm, right, it doesn't do anything.

> However, in HEAD it seems new messages come in
> every 30 seconds or so --- it looks to me like the autovacuum launcher
> is rather uselessly launching a new worker every few seconds, and the
> worker generates stats in the process of examining a database.

Correct, it's autovacuum causing it (turning autovac off makes it go
away).

> Can we damp that behavior down a bit in an idle system?

What we could do, I think, is to keep a counter of insert/update/delete
operations per database, and have autovac skip processing one if it sees
that it hasn't had any activity.  That would remove this particular
symptom.

(Magnus wanted to add the global counters anyway for some reason.)

> I'm not sure about Daniel's report of unprovoked writes every 500ms.
> It might be an artifact of the stats delay bug we fixed in 8.2.4,
> but this isn't the symptom that was reported.

Yup.  So going back to his original question,

> >> Before I get more involved
> >> with this, can someone just confirm that pgstat will continue to update
> >> this file even when nothing is happening?  If not, then I guess
> >> something /is/ happening and I need to investigate what it is

I suggest turning log_min_messages to debug2 and seeing if there is any
activity showing up.

--
Alvaro Herrera                                http://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.

В списке pgsql-general по дате отправления:

Предыдущее
От: Vivek Khera
Дата:
Сообщение: Re: Postgres Printed Manuals
Следующее
От: "Joshua D. Drake"
Дата:
Сообщение: Re: Postgres Printed Manuals