Re: Problems with autovacuum

From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Łukasz Jagiełło <lukasz(dot)jagiello(at)gforces(dot)pl>, Grzegorz Jaśkiewicz <gryzman(at)gmail(dot)com>, Scott Marlowe <scott(dot)marlowe(at)gmail(dot)com>, pgsql-performance(at)postgresql(dot)org
Subject: Re: Problems with autovacuum
Date: 2009-06-08 19:36:42
Message-ID: 20090608193642.GH5598@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Tom Lane escribió:

> Bingo, that's surely exactly what was happening to the OP. He had 2000
> databases and naptime at (I assume) the default; so he was rerunning
> rebuild_database_list every 100ms.
>
> So that recovery code path needs some more thought. Maybe a lower bound
> on how often to do rebuild_database_list? And/or don't set adl_next_worker
> to less than 100ms in the future to begin with?

I've been giving this some thought and tried several approaches. In the
end the one that I like the most is raising autovacuum_naptime to a
reasonable value for the exiting number of databases. The only problem
I have with it is that it's trivial to change it in the autovacuum
launcher process and have it stick, but there's no way to propagate the
value out to backends or postmaster to that they SHOW the actual value
in use by the launcher. The best I can do is emit a WARNING with the
new value.

I have experimented with other choices such as not rebuilding the
database list if the time elapsed since last rebuild is not very long,
but there were small problems with that so I'd prefer to avoid it.

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

Attachment Content-Type Size
autovac-incr-naptime.patch text/x-diff 1.3 KB

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Tom Lane 2009-06-08 20:16:54 Re: Problems with autovacuum
Previous Message Laszlo Nagy 2009-06-08 11:09:48 Re: Why is my stats collector so busy?