Re: autovacuum maintenance_work_mem

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
Cc: Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: autovacuum maintenance_work_mem
Date: 2010-11-16 17:27:05
Message-ID: AANLkTimFWE3rTBjvrmHorCixBPds4G056dLrk6ipgu8o@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Nov 16, 2010 at 11:12 AM, Alvaro Herrera
<alvherre(at)alvh(dot)no-ip(dot)org> wrote:
> Magnus was just talking to me about having a better way of controlling
> memory usage on autovacuum.  Instead of each worker using up to
> maintenance_work_mem, which ends up as a disaster when DBA A sets to a
> large value and DBA B raises autovacuum_max_workers, we could simply
> have an "autovacuum_maintenance_memory" setting (name TBD), that defines
> the maximum amount of memory that autovacuum is going to use regardless
> of the number of workers.
>
> So for the initial implementation, we could just have each worker set
> its local maintenance_work_mem to autovacuum_maintenance_memory / max_workers.
> That way there's never excessive memory usage.
>
> This implementation is not ideal, because most of the time they wouldn't
> use that much memory, and so vacuums could be slower.  But I think it's
> better than what we currently have.
>
> Thoughts?

I'm a little skeptical about creating more memory tunables. DBAs who
are used to previous versions of PG will find that their vacuum is now
really slow, because they adjusted maintenance_work_mem but not this
new parameter. If we could divide up the vacuum memory intelligently
between the workers in some way, that would be a win. But just
creating a different variable that controls the same thing in
different units doesn't seem to add much.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Eric Davies 2010-11-16 17:31:43 Re: SQL/MED estimated time of arrival?
Previous Message Heikki Linnakangas 2010-11-16 17:20:24 Re: autovacuum maintenance_work_mem