Re: Auto-tuning work_mem and maintenance_work_mem

From: Peter Geoghegan <pg(at)heroku(dot)com>
To: Bruce Momjian <bruce(at)momjian(dot)us>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>, Josh Berkus <josh(at)agliodbs(dot)com>
Subject: Re: Auto-tuning work_mem and maintenance_work_mem
Date: 2013-10-09 20:37:55
Message-ID: CAM3SWZT+TtiogW4TbHeh+puiDMvXy4tGZwgGkxEfJvy_AXiwgA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Oct 9, 2013 at 7:30 AM, Bruce Momjian <bruce(at)momjian(dot)us> wrote:
> Josh Berkus suggested here that work_mem and maintenance_work_mem could
> be auto-tuned like effective_cache_size:

Have you ever thought that the role of maintenance_work_mem was a bit
muddled? It recently occurred to me that it might be a good idea to
have a separate setting that is used to bound the amount of memory
used by autovacuum (and possibly VACUUM generally) in preference to
the more generic maintenance_work_mem setting.

In the docs, maintenance_work_mem has this caveat:

"Note that when autovacuum runs, up to autovacuum_max_workers times
this memory may be allocated, so be careful not to set the default
value too high."

If Heroku could increase maintenace_work_mem without having it affect
the amount of memory used by autovacuum workers, I'm fairly confident
that our setting would be higher. Sure, you can just increase it as
you need to, but you have to know about it in the first place, which
is asking too much of many people tasked with semi-routine maintenance
tasks like creating indexes.

--
Peter Geoghegan

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Josh Berkus 2013-10-09 21:11:47 Re: Auto-tuning work_mem and maintenance_work_mem
Previous Message Peter Geoghegan 2013-10-09 20:11:20 Re: INSERT...ON DUPLICATE KEY LOCK FOR UPDATE