タイプ: | enum |
デフォルト: | try |
コンテキスト: | postmaster |
再起動: | true |
値: | [off, on, try] |
以来: | 9.4 |
Controls whether huge pages are requested for the main shared memory area. Valid values are try
(the default), on
, and off
. With huge_pages
set to try
, the server will try to request huge pages, but fall back to the default if that fails. With on
, failure to request huge pages will prevent the server from starting up. With off
, huge pages will not be requested.
今のところこの機能はLinuxでのみサポートされています。 他のシステムではtry
と設定しても無視されます。
huge pageを使うと、ページテーブルが小さくなり、メモリ管理に使用されるCPU時間が少なくなり、性能が向上します。詳細は、linux-huge-pagesを見てください。
Huge pages are known as large pages on Windows. To use them, you need to assign the user right Lock Pages in Memory to the Windows user account that runs PostgreSQL. You can use Windows Group Policy tool (gpedit.msc) to assign the user right Lock Pages in Memory. To start the database server on the command prompt as a standalone process, not as a Windows service, the command prompt must be run as an administrator or User Access Control (UAC) must be disabled. When the UAC is enabled, the normal command prompt revokes the user right Lock Pages in Memory when started.
Note that this setting only affects the main shared memory area. Operating systems such as Linux, FreeBSD, and Illumos can also use huge pages (also known as super pages or large pages) automatically for normal memory allocation, without an explicit request from PostgreSQL. On Linux, this is called transparent huge pagestransparent huge pages (THP). That feature has been known to cause performance degradation with PostgreSQL for some users on some Linux versions, so its use is currently discouraged (unlike explicit use of huge_pages
).