Re: Auto-tuning work_mem and maintenance_work_mem

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Stephen Frost <sfrost(at)snowman(dot)net>
Cc: Kevin Grittner <kgrittn(at)ymail(dot)com>, Robert Haas <robertmhaas(at)gmail(dot)com>, Peter Geoghegan <pg(at)heroku(dot)com>, 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-10 15:33:36
Message-ID: 20131010153336.GO7092@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Oct 10, 2013 at 11:18:46AM -0400, Stephen Frost wrote:
> * Bruce Momjian (bruce(at)momjian(dot)us) wrote:
> > On Thu, Oct 10, 2013 at 07:24:26AM -0700, Kevin Grittner wrote:
> > > Robert Haas <robertmhaas(at)gmail(dot)com> wrote:
> > > > I actually had the thought that it might be something we'd integrate
> > > > *into* initdb.  So you'd do initdb --system-memory 8GB or something
> > > > like that and it would do the rest.  That'd be slick, at least IMHO.
> > >
> > > How would you handle the case that the machine (whether physical or
> > > a VM) later gets more RAM?  That's certainly not unheard of with
> > > physical servers, and with VMs I'm not sure that the database
> > > server would necessarily go through a stop/start cycle for it.
> >
> > Yes, going from a non-dedicated to a dedicated database server, adding
> > RAM, or moving the cluster to another server could all require an initdb
> > to change auto-tuned values. This is why I think we will need to
> > auto-tune in the backend, rather than via initdb. I do think an
> > available_mem parameter for initdb would help though, to be set in
> > postgresql.conf.
>
> For this case, I think the suggestion made by MauMau would be better-
> tell the user (in the postgresql.conf comments) a command they can run
> with different memory settings to see what the auto-tuning would do.
> Perhaps even have a way to enable use of those new variables, but I
> don't really care for the idea of making a GUC that isn't anything
> except a control for defaults of *other* GUCs.

Well, you then have two places you are doing the tuning --- one in
initdb, and another in the tool, and you can have cases where they are
not consistent. You could have a mode where initdb re-writes
postgresql.conf, but that has all sorts of oddities about changing a
config file.

--
Bruce Momjian <bruce(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://enterprisedb.com

+ Everyone has their own god. +

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Stephen Frost 2013-10-10 15:45:41 Re: Auto-tuning work_mem and maintenance_work_mem
Previous Message Bruce Momjian 2013-10-10 15:31:39 Re: Auto-tuning work_mem and maintenance_work_mem