Re: proposal: Set effective_cache_size to greater of .conf value, shared_buffers

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Magnus Hagander <magnus(at)hagander(dot)net>
Cc: Bruce Momjian <bruce(at)momjian(dot)us>, Andrew Dunstan <andrew(at)dunslane(dot)net>, Robert Haas <robertmhaas(at)gmail(dot)com>, Claudio Freire <klaussfreire(at)gmail(dot)com>, Merlin Moncure <mmoncure(at)gmail(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: proposal: Set effective_cache_size to greater of .conf value, shared_buffers
Date: 2013-09-05 16:48:54
Message-ID: 14627.1378399734@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Magnus Hagander <magnus(at)hagander(dot)net> writes:
> On Thu, Sep 5, 2013 at 3:01 AM, Bruce Momjian <bruce(at)momjian(dot)us> wrote:
>> I have developed the attached patch which implements an auto-tuned
>> effective_cache_size which is 4x the size of shared buffers. I had to
>> set effective_cache_size to its old 128MB default so the EXPLAIN
>> regression tests would pass unchanged.

> That's not really autotuning though. ISTM that making the *default* 4
> x shared_buffers might make perfect sense, but do we really need to
> hijack the value of "-1" for that? That might be useful for some time
> when we have actual autotuning, that somehow inspects the system and
> tunes it from there.

Well, the real problem with this patch is that it documents what the
auto-tuning algorithm is; without that commitment, just saying "-1 means
autotune" might be fine.

Did you consider the alternative of just tweaking initdb to insert a
default for effective_cache_size that's 4x whatever it picks for
shared_buffers? That would probably be about 3 lines of code, and it
wouldn't nail down any particular server-side behavior.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2013-09-05 16:52:20 Re: INSERT...ON DUPLICATE KEY IGNORE
Previous Message Robert Haas 2013-09-05 16:46:16 Re: Where can I find the code for extern OidFunctionCall7?