{"Entry":{"collection":"guc","key":"huge_page_size","name":"huge_page_size","aliases":[],"metadata":{"baseline":false,"boot_human":"Not specified","boot_val":null,"category":"Resource Usage / Memory","category_zh":"","changed_in":["18"],"changes":[{"documentation_changed":false,"fields":{},"from":"13","status":"added","to":"14"},{"documentation_changed":true,"fields":{},"from":"16","status":"changed","to":"17"},{"documentation_changed":false,"fields":{"extra_desc":{"from":null,"to":"0 means use the system default."}},"from":"17","status":"changed","to":"18"}],"content_hash":"f584276ec138599ac5ed658a098762c63af59bad2db366ac219abf6be8fb3ad2","context":"","default_changed_in":[],"default_history":[{"from":"14","to":"19","value":"0 B"}],"editorial":{"advice":{"olap":"A large main shared-memory region can make page-table savings material, but the useful size depends on architecture, kernel pools, fragmentation, and restart operations—not bulk-I/O throughput. Benchmark the exact host and preserve enough ordinary memory for backends and the OS.","oltp":"Keep 0 so PostgreSQL uses the system's default explicit huge-page size. Choose a nonzero size only on Linux after provisioning the matching huge-page pool and verifying startup plus huge_pages_status with the intended shared-memory footprint.","small":"Keep 0. A nondefault explicit size adds kernel provisioning and startup-failure risk that rarely pays back on a small shared-memory allocation."},"mechanism":["huge_page_size selects the explicit huge-page size requested for PostgreSQL's main shared-memory area when huge_pages is used. Zero means the operating system's default huge-page size.","This is a startup allocation choice, not an amount of memory. Supported nonzero sizes are architecture and kernel dependent, and PostgreSQL currently supports nondefault selection only on Linux.","The requested page size must match provisioned huge-page pools and the shared-memory allocation. It affects the main shared area, not ordinary backend allocations such as work_mem. Its postmaster context fixes the value at server start; changing it requires a restart."],"pitfalls":["Reading 0 as zero-byte huge pages rather than 'use the system default huge-page size'.","Selecting a nonzero size on a non-Linux platform, where nondefault sizes are not supported.","Requesting a page size whose kernel pool has not been provisioned and causing startup failure when huge_pages=on.","Confusing explicit huge pages for the main shared-memory area with Transparent Huge Pages or per-backend memory."],"references":[{"title":"PostgreSQL 19 Beta 4: huge_page_size","url":"https://www.postgresql.org/docs/19/runtime-config-resource.html#GUC-HUGE-PAGE-SIZE"},{"title":"PostgreSQL 19 release notes","url":"https://www.postgresql.org/docs/19/release-19.html"}],"related":["huge_pages","huge_pages_status","shared_buffers","shared_memory_type","min_dynamic_shared_memory"],"summary":"huge_page_size — The size of huge page that should be requested. Observed in PG14–19 Beta 4; its last measured boot default is 0 B in PG19 Beta 4, with postmaster context. This is a beta-snapshot fact and can change before PostgreSQL 19 GA."},"enumvals":[],"first_version":"14","group":"Resource Usage","group_slug":"resource","imported_at":"2026-09-27T17:57:31.357847+08:00","intro_commit":{"authored_at":"2020-07-17T14:33:00+12:00","discussion":["https://postgr.es/m/20200608154639.20254-1-odin%40ugedal.com"],"hash":"d2bddc2500fb74d56e5bc53a1cfa269e2e846510","subject":"Add huge_page_size setting for use on Linux.","url":"https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=d2bddc2500fb74d56e5bc53a1cfa269e2e846510"},"key":"huge_page_size","last_version":"20","max_val":"","min_val":"","name":"huge_page_size","position":168,"present_in":["14","15","16","17","18","19","20"],"short_desc":"Controls the size of huge pages, when they are enabled with huge_pages.","short_desc_zh":"","source_rev":"english-manuals:f1aaac445e1e14c734c899e4fab738d5ca914d59da570fee7040d8f80984d44b","unit":"","vartype":"integer"}},"Definition":{"Collection":"guc","Key":"huge_page_size","SourceDatabase":"center","Version":"18","SourceTable":"guc","SourceKey":"huge_page_size","SourceRevision":"english-manuals:f1aaac445e1e14c734c899e4fab738d5ca914d59da570fee7040d8f80984d44b","Facts":{"boot_val":"0","category":"Resource Usage / Memory","context":"postmaster","description":"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 Section 18.4.5. Non-default settings are currently supported only on Linux.","doc":{"anchor":"GUC-HUGE-PAGE-SIZE","file":"runtime-config-resource.html","lang":"en","sha256":"2e207c599f0884dfbe594558c478a2c7c132578981071e980e2015f31dfce28c","slug":"18"},"documented":true,"enumvals":null,"extra_desc":"0 means use the system default.","lang":"en","max_val":"2147483647","metadata_version":"18","min_val":"0","name":"huge_page_size","short_desc":"The size of huge page that should be requested.","source":"pg-settings-source-snapshot","unit":"kB","vartype":"integer"},"ManualEvidence":{"doc":{"anchor":"GUC-HUGE-PAGE-SIZE","file":"runtime-config-resource.html","lang":"en","sha256":"2e207c599f0884dfbe594558c478a2c7c132578981071e980e2015f31dfce28c","slug":"18"}},"MeasuredEvidence":{"metadata_version":"18"}},"Text":{"Collection":"guc","Key":"huge_page_size","SourceDatabase":"pgweb","Version":"18","Locale":"zh-Hans","Title":"huge_page_size","Summary":"","BodyHTML":"\u003cp\u003e控制通过\u003ca href=\"/docs/18/runtime-config-resource.html#GUC-HUGE-PAGES\" rel=\"nofollow\"\u003ehuge_pages\u003c/a\u003e启用巨型页时所使用的页大小。默认值为零（\u003ccode\u003e0\u003c/code\u003e）。设置为 \u003ccode\u003e0\u003c/code\u003e 时，使用系统默认的巨型页大小。此参数只能在服务器启动时设置。\u003c/p\u003e\u003cp\u003e现代 64 位服务器体系结构上常见的页大小包括：\u003ccode\u003e2MB\u003c/code\u003e 和 \u003ccode\u003e1GB\u003c/code\u003e（Intel 和 AMD），\u003ccode\u003e16MB\u003c/code\u003e 和 \u003ccode\u003e16GB\u003c/code\u003e（IBM POWER），以及 \u003ccode\u003e64kB\u003c/code\u003e、\u003ccode\u003e2MB\u003c/code\u003e、\u003ccode\u003e32MB\u003c/code\u003e 和 \u003ccode\u003e1GB\u003c/code\u003e（ARM）。关于使用和支持的更多信息，参见\u003ca href=\"/docs/18/kernel-resources.html#LINUX-HUGE-PAGES\" rel=\"nofollow\"\u003e第 18.4.5 节\u003c/a\u003e。\u003c/p\u003e\u003cp\u003e目前只有 Linux 支持非默认设置。\u003c/p\u003e","SourceRevision":"2026-09-11@29c86d9","ContentHash":"48ce101c84c101b41171ab5bd3c2eb952d84850cfac0226e84e4e98c262fc56d","Payload":{"carried_from":"","carry_reason":"","doc_html":"\u003cp\u003e控制通过\u003ca href=\"/docs/18/runtime-config-resource.html#GUC-HUGE-PAGES\"\u003ehuge_pages\u003c/a\u003e启用巨型页时所使用的页大小。默认值为零（\u003ccode class=\"literal\"\u003e0\u003c/code\u003e）。设置为 \u003ccode class=\"literal\"\u003e0\u003c/code\u003e 时，使用系统默认的巨型页大小。此参数只能在服务器启动时设置。\u003c/p\u003e\u003cp\u003e现代 64 位服务器体系结构上常见的页大小包括：\u003ccode class=\"literal\"\u003e2MB\u003c/code\u003e 和 \u003ccode class=\"literal\"\u003e1GB\u003c/code\u003e（Intel 和 AMD），\u003ccode class=\"literal\"\u003e16MB\u003c/code\u003e 和 \u003ccode class=\"literal\"\u003e16GB\u003c/code\u003e（IBM POWER），以及 \u003ccode class=\"literal\"\u003e64kB\u003c/code\u003e、\u003ccode class=\"literal\"\u003e2MB\u003c/code\u003e、\u003ccode class=\"literal\"\u003e32MB\u003c/code\u003e 和 \u003ccode class=\"literal\"\u003e1GB\u003c/code\u003e（ARM）。关于使用和支持的更多信息，参见\u003ca href=\"/docs/18/kernel-resources.html#LINUX-HUGE-PAGES\" title=\"18.4.5. Linux 大页\"\u003e第 18.4.5 节\u003c/a\u003e。\u003c/p\u003e\u003cp\u003e目前只有 Linux 支持非默认设置。\u003c/p\u003e","doc_same_as":""}},"RequestedLocale":"zh-Hans","Fallback":false,"Versions":["14","15","16","17","18","19","20"],"Locales":["en","zh-Hans"],"Signatures":null,"Spellings":null,"SQLState":null,"Evidence":null}
