Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1no45D-0005Tz-Uh for pgsql-admin@arkaria.postgresql.org; Mon, 09 May 2022 14:09:56 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1no45C-0000nY-RR for pgsql-admin@arkaria.postgresql.org; Mon, 09 May 2022 14:09:54 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1no45B-0000m5-NC for pgsql-admin@lists.postgresql.org; Mon, 09 May 2022 14:09:54 +0000 Received: from resqmta-c1p-024062.sys.comcast.net ([2001:558:fd00:56::7]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1no456-0000sJ-Ra for pgsql-admin@lists.postgresql.org; Mon, 09 May 2022 14:09:52 +0000 Received: from resomta-c1p-023810.sys.comcast.net ([96.102.18.241]) by resqmta-c1p-024062.sys.comcast.net with ESMTP id o1gpnLqoVVPOto451nIpMe; Mon, 09 May 2022 14:09:43 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=comcast.net; s=20190202a; t=1652105383; bh=TZ+kEJzt+S8IGMo+I3a+0FdE2XBqxCHBbtCnxWz1mgo=; h=Received:Received:Content-Type:Mime-Version:Subject:From:Date: Message-Id:To; b=d7B5Up9aKBv0i99wPXDCPD4nB8Tz2M2fVBMDJvMIsM6FKO87e/yVdknhXh8hs04wA Nogg3v6+G6f+bheqVD8YfbS4GSKRtaaWbv9lXFzEf18YRUviwfGV34feSqdrdEsbfV PeM+6Aq4NglRaRWCVj80+I5ArkOhxSCS7xKDN1xe4i+KrUgD6bkaQv/jXP56tMtZBl Ja0ZRgrRtjIPHJAhmZHUq0wfE+gSxhTPxY4XoXMyTPGcb/pRISNiNNhwNTVb8bCnQt eyDCWO1n7t0ZkytcbKa+36p+OI36ibNrvZrASIoXj2JbE/5j+DGtB+uzLfDJbFBaUK EEmJcoSLRthOA== Received: from smtpclient.apple ([IPv6:2601:240:d081:59d0:8510:e2:83dc:d8c]) by resomta-c1p-023810.sys.comcast.net with ESMTPA id o44enF7gxw1mJo44fnZQrW; Mon, 09 May 2022 14:09:21 +0000 X-Xfinity-VMeta: sc=0.00;st=legit Content-Type: multipart/alternative; boundary="Apple-Mail=_4C1C67D3-8A86-479D-929C-66004DF2790B" Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.80.82.1.1\)) Subject: Re: PostgreSQL14.2 can not start because of huge_page_size is equal to 1048576 From: John Wiencek X-Priority: 3 In-Reply-To: <7eb12667.554a.180a91ba17c.Coremail.msdnchina@163.com> Date: Mon, 9 May 2022 09:09:20 -0500 Cc: pgsql-admin@lists.postgresql.org Message-Id: References: <7eb12667.554a.180a91ba17c.Coremail.msdnchina@163.com> To: =?utf-8?B?57G75bu26Imv?= X-Mailer: Apple Mail (2.3696.80.82.1.1) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --Apple-Mail=_4C1C67D3-8A86-479D-929C-66004DF2790B Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 Found this: = https://www.postgresql.org/docs/current/kernel-resources.html#LINUX-HUGE-P= AGES = See section: 19.4.5. Linux Huge Pages "The default behavior for huge pages in PostgreSQL is to use them when = possible, with the system's default huge page size, and to fall back to = normal pages on failure. To enforce the use of huge pages, you can set = huge_pages = to on in postgresql.conf. Note that with this setting = PostgreSQL will fail to start if not enough huge pages are available.=E2=80= =9D > On May 9, 2022, at 8:56 AM, =E7=B1=BB=E5=BB=B6=E8=89=AF = wrote: >=20 > My rhel 7.9 enabled 1GB hugepagesize,and in this rhel7.9,there is a = postgresql 14.2 (from compile installation). > [root@localhost ~]# cat /proc/meminfo |grep -i hugep > AnonHugePages: 8192 kB > HugePages_Total: 0 > HugePages_Free: 0 > HugePages_Rsvd: 0 > HugePages_Surp: 0 > Hugepagesize: 1048576 kB > [root@localhost ~]# hugeadm --pool-list > Size Minimum Current Maximum Default > 1073741824 0 0 0 * > [root@localhost ~]#=20 >=20 >=20 >=20 > after I change pg parameter huge_page_size to 1048576=EF=BC=8C I can = not start PostgreSQL 14.2 . the following is the error, > [pg142@localhost data]$ grep huge postgresql.conf > #huge_pages =3D try # on, off, or try > huge_page_size =3D 1048576 # zero for system = default > [pg142@localhost data]$ pg_ctl start > waiting for server to start....2022-05-09 04:36:58.220 GMT [1719] LOG: = invalid value for parameter "huge_page_size": 1048576 > 2022-05-09 04:36:58.220 GMT [1719] DETAIL: huge_page_size must be 0 = on this platform. > 2022-05-09 12:36:58.220 CST [1719] FATAL: configuration file = "/home/pg142/data/postgresql.conf" contains errors > stopped waiting > pg_ctl: could not start server > Examine the log output. > [pg142@localhost data]$=20 >=20 > I want to know why =EF=BC=9F >=20 >=20 > =20 --Apple-Mail=_4C1C67D3-8A86-479D-929C-66004DF2790B Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8 Found= this:


See section:    19.4.5. Linux Huge Pages

"The = default behavior for huge pages in PostgreSQL is to use them when possible, with the system's default = huge page size, and to fall back to normal pages on failure. To enforce = the use of huge pages, you can set huge_pages to on in postgresql.conf. Note that with this = setting PostgreSQL will fail to start = if not enough huge pages are available.=E2=80=9D




On May 9, 2022, at 8:56 AM, =E7=B1=BB=E5=BB=B6=E8= =89=AF <msdnchina@163.com> wrote:

My rhel 7.9 enabled 1GB hugepagesize,and in = this rhel7.9,there is a postgresql 14.2 (from compile = installation).
[root@localhost ~]# = cat /proc/meminfo |grep -i hugep
AnonHugePages: =     8192 kB
HugePages_Total:  =      0
HugePages_Free:    =     0
HugePages_Rsvd:      =   0
HugePages_Surp:        = 0
Hugepagesize:    1048576 kB
[root@localhost ~]# hugeadm --pool-list
      Size  Minimum  Current  = Maximum  Default
1073741824    =     0        0        = 0        *
[root@localhost = ~]# 



after I change pg parameter huge_page_size to 1048576=EF=BC=8C = I can not start PostgreSQL 14.2 . the following is the error,
[pg142@localhost data]$ = grep huge postgresql.conf
#huge_pages =3D try # on, = off, or try
huge_page_size =3D 1048576 # zero = for system default
[pg142@localhost data]$ pg_ctl = start
waiting for server to start....2022-05-09 = 04:36:58.220 GMT [1719] LOG:  invalid value for parameter = "huge_page_size": 1048576
2022-05-09 04:36:58.220 = GMT [1719] DETAIL:  huge_page_size must be 0 on this = platform.
2022-05-09 12:36:58.220 CST [1719] = FATAL:  configuration file "/home/pg142/data/postgresql.conf" = contains errors
 stopped waiting
pg_ctl: could not start server
Examine = the log output.
[pg142@localhost = data]$ 

I want to know why =EF=BC=9F


 
<= br class=3D"">
= --Apple-Mail=_4C1C67D3-8A86-479D-929C-66004DF2790B--