Re: Improve logging when using Huge Pages

From: Andres Freund <andres(at)anarazel(dot)de>
To: John Naylor <john(dot)naylor(at)enterprisedb(dot)com>
Cc: Thomas Munro <thomas(dot)munro(at)gmail(dot)com>, "Shinoda, Noriyoshi (PN Japan FSIP)" <noriyoshi(dot)shinoda(at)hpe(dot)com>, Jacob Champion <jchampion(at)timescale(dot)com>, Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com>, Fujii Masao <masao(dot)fujii(at)oss(dot)nttdata(dot)com>, Justin Pryzby <pryzby(at)telsasoft(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>, Julien Rouhaud <rjuju123(at)gmail(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Kyotaro Horiguchi <horikyota(dot)ntt(at)gmail(dot)com>
Subject: Re: Improve logging when using Huge Pages
Date: 2022-11-07 15:14:58
Message-ID: 20221107151458.6puzamerxti2y5in@awork3.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

On 2022-11-06 14:04:29 +0700, John Naylor wrote:
> I think the best thing to do is change huge_pages='on' to log a WARNING and
> fallback to regular pages if the mapping fails. That way, both dev and prod
> can keep the same settings, since 'on' will have both visibility and
> robustness. I don't see a good reason to refuse to start -- seems like an
> anti-pattern.

How would on still have robustness if it doesn't actually do anything other
than cause a WARNING? The use of huge pages can have very substantial effects
on memory usage an performance. And it's easy to just have huge_pages fail,
another program that started could have used huge pages, or some config
variables was changed to incerase shared memory usage...

I am strongly opposed to making 'on' fall back to not using huge pages. That's
what 'try' is for.

I know of people that scripted cluster start so that they start with 'on' and
change the system setting of the number of huge pages according to the error
message.

Greetings,

Andres Freund

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Jonathan S. Katz 2022-11-07 15:30:24 Re: Draft back-branch release notes are up
Previous Message Peter Eisentraut 2022-11-07 15:08:17 Re: WIN32 pg_import_system_collations