Re: [HACKERS] Too many autovacuum workers spawned during forcedauto-vacuum

Поиск
Список
Период
Сортировка
От Alvaro Herrera
Тема Re: [HACKERS] Too many autovacuum workers spawned during forcedauto-vacuum
Дата
Msg-id 20170113134523.zhtfj5nkuqu43bt6@alvherre.pgsql
обсуждение исходный текст
Ответ на [HACKERS] Too many autovacuum workers spawned during forced auto-vacuum  (Amit Khandekar <amitdkhan.pg@gmail.com>)
Список pgsql-hackers
Amit Khandekar wrote:
> In a server where autovacuum is disabled and its databases reach
> autovacuum_freeze_max_age limit, an autovacuum is forced to prevent
> xid wraparound issues. At this stage, when the server is loaded with a
> lot of DML operations, an exceedingly high number of autovacuum
> workers keep on getting spawned, and these do not do anything, and
> then quit.

I think this is the same problem as reported in
https://www.postgresql.org/message-id/CAMkU=1yE4YyCC00W_GcNoOZ4X2qxF7x5DUAR_kMt-Ta=YPyFPQ@mail.gmail.com

> === Fix ===
[...]
> Instead, the attached patch (prevent_useless_vacuums.patch) prevents
> the repeated cycle by noting that there's no point in doing whatever
> vac_update_datfrozenxid() does, if we didn't find anything to vacuum
> and there's already another worker vacuuming the same database. Note
> that it uses wi_tableoid field to check concurrency. It does not use
> wi_dboid field to check for already-processing worker, because using
> this field might cause each of the workers to think that there is some
> other worker vacuuming, and eventually no one vacuums. We have to be
> certain that the other worker has already taken a table to vacuum.

Hmm, it seems reasonable to skip the end action if we didn't do any
cleanup after all.  This would normally give enough time between vacuum
attempts for the first worker to make further progress and avoid causing
a storm.  I'm not really sure that it fixes the problem completely, but
perhaps it's enough.

-- 
Álvaro Herrera                https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services



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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: [HACKERS] parallelize queries containing subplans
Следующее
От: Tom Lane
Дата:
Сообщение: Re: [HACKERS] Protect syscache from bloating with negative cache entries