Re: autovacuum launcher eating too much CPU

Поиск
Список
Период
Сортировка
От Alvaro Herrera
Тема Re: autovacuum launcher eating too much CPU
Дата
Msg-id 20070913170352.GB1716@alvh.no-ip.org
обсуждение исходный текст
Ответ на autovacuum launcher eating too much CPU  (Alvaro Herrera <alvherre@commandprompt.com>)
Список pgsql-hackers
Alvaro Herrera wrote:

> Darcy Buskermolen noticed that when one has many databases, the autovac
> launcher starts eating too much CPU.
>
> I tried it here with 200 databases and indeed it does seem to eat its
> share.  Even with the default naptime, which I wouldn't have thought
> that was too high (it does make the launcher wake up about three times a
> second though).

This patch does not solve the whole problem but it alleviates it a bit
by throttling pgstat reads.  One problem with it is that the interval
for this increases:

        /*
         * Check whether pgstat data still says we need to vacuum this table.
         * It could have changed if something else processed the table while we
         * weren't looking.
         *
         * FIXME we ignore the possibility that the table was finished being
         * vacuumed in the last 500ms (PGSTAT_STAT_INTERVAL).  This is a bug.
         */
        MemoryContextSwitchTo(AutovacMemCxt);
        tab = table_recheck_autovac(relid);

which could be a problem in itself, by causing unnecessary vacuums.

Opinions?

--
Alvaro Herrera                 http://www.amazon.com/gp/registry/DXLWNGRJD34J
"In Europe they call me Niklaus Wirth; in the US they call me Nickel's worth.
 That's because in Europe they call me by name, and in the US by value!"

Вложения

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

Предыдущее
От: "Pavan Deolasee"
Дата:
Сообщение: Re: HOT line pointer bloat and PageRepairFragmentation
Следующее
От: "Joshua D. Drake"
Дата:
Сообщение: Re: Postgresql.conf cleanup