Re: Setting huge_pages=off when HugePages are allocated in Linux?

From: Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>
To: Ron Johnson <ronljohnsonjr(at)gmail(dot)com>, Pgsql-admin <pgsql-admin(at)lists(dot)postgresql(dot)org>
Subject: Re: Setting huge_pages=off when HugePages are allocated in Linux?
Date: 2026-01-28 17:02:26
Message-ID: a22c57a4b9cd72edbd210574018eeb09e3cec9df.camel@cybertec.at
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-admin

On Wed, 2026-01-28 at 10:31 -0500, Ron Johnson wrote:
> In the example in this (quite helpful) Cybertec post, 10475 HugePages are allocated. 
> https://www.cybertec-postgresql.com/en/huge-pages-postgresql/
>
> If we set "huge_pages = off" within PG and then restart PG, will Linux see those 10475 HugePages as off-limits to normal 4KiB allocations?

Yes. That's why it is a good idea to set "huge_pages = on" if you intend to use them with
PostgreSQL. Otherwise it may happen that PostgreSQL resorts to allocating shared buffers
using normal memory, and your huge pages just sit around and are wasted.

Yours,
Laurenz Albe

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Wasim Devale 2026-01-28 19:15:42 Restoration process generates 1.2 TB of WAL files.
Previous Message Ron Johnson 2026-01-28 15:31:36 Setting huge_pages=off when HugePages are allocated in Linux?