Re:Re: PostgreSQL14.2 can not start because of huge_page_size is equal to 1048576

From: "yanliang lei" <msdnchina(at)163(dot)com>
To: Ron <ronljohnsonjr(at)gmail(dot)com>
Cc: pgsql-admin(at)lists(dot)postgresql(dot)org
Subject: Re:Re: PostgreSQL14.2 can not start because of huge_page_size is equal to 1048576
Date: 2022-05-09 16:15:55
Message-ID: 6a96927b.58ac.180a99b170a.Coremail.msdnchina@163.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Thanks a lot for your reply!

The DETAIL message says " huge_page_size must be 0", but you did not set huge_page_size to 0.
---huge_page_size is the pg14 new parameter,The default value of this parameter is zero (0). When set to 0, the default huge page size on the system will be used.
in the pg 14 documents---‘Non-default settings are currently supported only on Linux.’ so , I want to try to find a method to let PostgreSQL 14 to use non-default hugepagesize,
if the documents tell me---"Non-default settings are not supported on Linux", I won't do the following test case!
From the result of the following test case,we can see: PostgreSQL 14.2 software start log “huge_page_size must be 0 on this platform” and the pg 14 documents---‘Non-default settings are currently supported only on Linux. ----These two descriptions are obviously contradictory!!!

the following is my latest test case:

[root(at)localhost ~]# echo 2072 > /sys/kernel/mm/hugepages/hugepages-2048kB/nr_hugepages

[root(at)localhost ~]# cat /sys/kernel/mm/hugepages/hugepages-2048kB/nr_hugepages

2057

[root(at)localhost ~]#

[root(at)localhost ~]#

[root(at)localhost ~]# cd $PGDATA

[root(at)localhost data]# grep huge postgresql.conf

grep: postgresql.conf: No such file or directory

[root(at)localhost data]# su - pg142

Last login: Mon May 9 22:47:48 CST 2022 on pts/0

[pg142(at)localhost ~]$ cd $PGDATA

[pg142(at)localhost data]$ grep huge postgresql.conf

huge_pages = try # on, off, or try

huge_page_size = 2048 # zero for system default

[pg142(at)localhost data]$ hugeadm --pool-list

Size Minimum Current Maximum Default

2097152 2057 2057 2057 ---->>>but non-default hugepagesize is 2048KB

1073741824 3 3 3 * ---->>>default hugepagesize is 1gb

[pg142(at)localhost data]$ pg_ctl start

waiting for server to start....2022-05-09 15:09:15.023 GMT [1733] LOG: invalid value for parameter "huge_page_size": 2048 --->>> I want to use 2M hugepagesize

2022-05-09 15:09:15.023 GMT [1733] DETAIL: huge_page_size must be 0 on this platform.

2022-05-09 23:09:15.023 CST [1733] FATAL: configuration file "/home/pg142/data/postgresql.conf" contains errors

stopped waiting

pg_ctl: could not start server

Examine the log output.

[pg142(at)localhost data]$

在 2022-05-09 23:39:52,"Ron" <ronljohnsonjr(at)gmail(dot)com> 写道:

On 5/9/22 08:56, 类延良 wrote:

My rhel 7.9 enabled 1GB hugepagesize,and in this rhel7.9,there is a postgresql 14.2 (from compile installation).
[root(at)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(at)localhost ~]# hugeadm --pool-list
Size Minimum Current Maximum Default
1073741824 0 0 0 *
[root(at)localhost ~]#

after I change pg parameter huge_page_size to 1048576, I can not start PostgreSQL 14.2 . the following is the error,

[pg142(at)localhost data]$ grep huge postgresql.conf
#huge_pages = try# on, off, or try
huge_page_size = 1048576# zero for system default
[pg142(at)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(at)localhost data]$

I want to know why ?

The DETAIL message says " huge_page_size must be 0", but you did not set huge_page_size to 0.

That may be the problem.

--
Angular momentum makes the world go 'round.

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Tom Lane 2022-05-09 16:27:14 Re: PostgreSQL14.2 can not start because of huge_page_size is equal to 1048576
Previous Message Ron 2022-05-09 15:39:52 Re: PostgreSQL14.2 can not start because of huge_page_size is equal to 1048576