Re: Estimating HugePages Requirements?

From: "Bossart, Nathan" <bossartn(at)amazon(dot)com>
To: Kyotaro Horiguchi <horikyota(dot)ntt(at)gmail(dot)com>
Cc: "michael(at)paquier(dot)xyz" <michael(at)paquier(dot)xyz>, "pryzby(at)telsasoft(dot)com" <pryzby(at)telsasoft(dot)com>, "andres(at)anarazel(dot)de" <andres(at)anarazel(dot)de>, "magnus(at)hagander(dot)net" <magnus(at)hagander(dot)net>, "mark(dot)dilger(at)enterprisedb(dot)com" <mark(dot)dilger(at)enterprisedb(dot)com>, "don(at)seiler(dot)us" <don(at)seiler(dot)us>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Estimating HugePages Requirements?
Date: 2021-09-03 17:46:05
Message-ID: C7F4DD29-549E-4EA3-87DA-D08D48B57B03@amazon.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin pgsql-hackers

On 9/2/21, 10:12 PM, "Kyotaro Horiguchi" <horikyota(dot)ntt(at)gmail(dot)com> wrote:
> By the way I noticed that postgres -C huge_page_size shows 0, which I
> think should have the number used for the calculation if we show
> huge_page_required.

I would agree with this if huge_page_size was a runtime-computed GUC,
but since it's intended for users to explicitly request the huge page
size, it might be slightly confusing. Perhaps another option would be
to create a new GUC for this. Or maybe it's enough to note that the
value will be changed from 0 at runtime if huge pages are supported.
In any case, it might be best to handle this separately.

> I noticed that postgres -C shared_memory_size showed 137 (= 144703488)
> whereas the error message above showed 148897792 bytes (142MB). So it
> seems that something is forgotten while calculating
> shared_memory_size. As the consequence, launching postgres setting
> huge_pages_required (69 pages) as vm.nr_hugepages ended up in the
> "could not map anonymous shared memory" error.

Hm. I'm not seeing this with the v5 patch set, so maybe I
inadvertently fixed it already. Can you check this again with v5?

Nathan

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Andres Freund 2021-09-03 20:20:59 Re: Estimating HugePages Requirements?
Previous Message Bossart, Nathan 2021-09-03 17:36:43 Re: Estimating HugePages Requirements?

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2021-09-03 17:46:46 Re: prevent immature WAL streaming
Previous Message Alvaro Herrera 2021-09-03 17:45:50 Re: pgsql: Set the volatility of the timestamptz version of date_bin() back