Re: BUG #17757: Not honoring huge_pages setting during initdb causes DB crash in Kubernetes

Tom Lane <tgl@sss.pgh.pa.us>

From: Tom Lane <tgl@sss.pgh.pa.us>
To: Andres Freund <andres@anarazel.de>
Cc: Tomas Vondra <tomas.vondra@enterprisedb.com>, david_sisson@dell.com, pgsql-bugs@lists.postgresql.org
Date: 2023-01-22T00:08:01Z
Lists: pgsql-bugs
Andres Freund <andres@anarazel.de> writes:
> Perhaps we should add an option to force MAP_POPULATE being used? I'm fairly
> certain that'd avoid the SIGBUS in this case. And it'd make sense to ensure
> that we can actually use the memory in initdb.

> Unfortunately it's not unproblematic to use it in general, because with large
> shared_buffers values it can be quite slow, because the kernel initializes the
> memory in a single thread. I've seen ~3GB/s on multi-socket machines.

Hmm ... but if we can't use it by default, we're still back to the
problem of needing a way to tell initdb to do things differently.
I'd just as soon keep that to "set huge_pages = off" rather than
inventing whole new things.

			regards, tom lane