Controls the size of huge pages, when they are enabled with huge_pages.
At a glance
| Property | Value |
|---|---|
| Parameter | huge_page_size |
| Category | Resource Consumption |
| Default | zero |
| Value type | integer |
| Change scope | Server restart required (postgresql.conf) |
| Available in | PostgreSQL 14, 15, 16, 17, 18, 19 (added in 14) |
What it does
Controls the size of huge pages, when they are enabled with huge_pages. The default is zero (0). When set to 0, the default huge page size on the system will be used. This parameter can only be set at server start.
Some commonly available page sizes on modern 64 bit server architectures include: 2MB and 1GB (Intel and AMD), 16MB and 16GB (IBM POWER), and 64kB, 2MB, 32MB and 1GB (ARM). For more information about usage and support, see linux_huge_pages.
(Description quoted from the official PostgreSQL documentation.)
How to apply a change
Set it in postgresql.conf (or with ALTER SYSTEM) and restart the server — this parameter cannot change without a restart.
Inspect the current value and source with SHOW huge_page_size; or SELECT name, setting, unit, context, source FROM pg_settings WHERE name = 'huge_page_size';.
Tuning guidance
This parameter is rarely a performance lever. Leave it at the default unless you have a specific, documented reason to change it, change it on one session or one role/database first, and confirm the effect with pg_settings and your own measurements before rolling it out cluster-wide.