Re: [Patch] change the default value of shared_buffers in postgresql.conf.sample - Mailing list pgsql-hackers

From Magnus Hagander
Subject Re: [Patch] change the default value of shared_buffers in postgresql.conf.sample
Date
Msg-id CABUevEzT37KZwSnBeNBm0NRJxTAM61xg0XEXgDE0BJ62c==ZxQ@mail.gmail.com
Whole thread Raw
In response to Re: [Patch] change the default value of shared_buffers in postgresql.conf.sample  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: [Patch] change the default value of shared_buffers in postgresql.conf.sample
List pgsql-hackers
On Thu, Jun 24, 2021 at 5:49 PM Tom Lane <tgl@sss.pgh.pa.us> wrote:
>
> "zhangjie2@fujitsu.com" <zhangjie2@fujitsu.com> writes:
> > In PostgreSQL 14, The default value of shared_buffers is 128MB, but in postgresql.conf.sample, the default value of
shared_buffersis 32MB.
 
> > I think the following changes should be made.
>
> > File: postgresql\src\backend\utils\misc\ postgresql.conf.sample
> > #shared_buffers = 32MB  =>  #shared_buffers = 128MB
>
> As submitted, this patch breaks initdb, which is looking for the exact
> string "#shared_buffers = 32MB".
>
> We could adjust that too of course, but I'm dubious first that any
> change is needed, and second that this is the right one:
>
> 1. Since initdb will replace that string, users will never see this
> entry as-is in live databases.  So is it worth doing anything?

It's not entirely uncommon that users copy the .sample file into their
configuration management system and then generate the real config from
that using templates. These users will definitely see it (and
overwrite it).


> 2. The *actual*, hard-wired, default in guc.c is 1024 (8MB), not
> either of these numbers.  So maybe the sample file ought to use
> that instead.  Or maybe we should change that value too ... it's
> surely as obsolete as can be.

+1 for changing this one as well. It'a always been slightly confusing,
since it's what shows up in pg_settings. If anything I'd consider that
an oversight when the defaults were changed back then...


> On the whole this seems pretty cosmetic so I'm inclined to leave
> it alone.  But if we were going to do anything I think that
> adjusting both initdb.c and guc.c to use 128MB might be the
> most appropriate thing.

It is mostly cosmetic, but it is cosmetic at a level that can cause at
least a small amount of confusion for users, so I'm definitely +1 for
cleaning it up.

-- 
 Magnus Hagander
 Me: https://www.hagander.net/
 Work: https://www.redpill-linpro.com/



pgsql-hackers by date:

Previous
From: Dilip Kumar
Date:
Subject: Re: Allow streaming the changes after speculative aborts.
Next
From: Noah Misch
Date:
Subject: Re: Dump public schema ownership & seclabels