Re: Estimating HugePages Requirements?
Michael Paquier <michael@paquier.xyz>
From: Michael Paquier <michael@paquier.xyz>
To: "Bossart, Nathan" <bossartn@amazon.com>
Cc: Justin Pryzby <pryzby@telsasoft.com>, Andres Freund <andres@anarazel.de>, Magnus Hagander <magnus@hagander.net>, Mark Dilger <mark.dilger@enterprisedb.com>, Don Seiler <don@seiler.us>, "pgsql-hackers@postgresql.org" <pgsql-hackers@postgresql.org>
Date: 2021-09-01T06:53:52Z
Lists: pgsql-hackers
On Tue, Aug 31, 2021 at 05:37:52AM +0000, Bossart, Nathan wrote: > I moved the GUC calculation to ipci.c, adjusted the docs, and added a > huge_pages_required GUC. It's still a little rough around the edges, > and I haven't tested it on Windows, but this seems like the direction > the patch is headed. Hmm. I am not sure about the addition of huge_pages_required, knowing that we would have shared_memory_size. I'd rather let the calculation part to the user with a scan of /proc/meminfo. +#elif defined(WIN32) + hp_size = GetLargePageMinimum(); +#endif + +#if defined(MAP_HUGETLB) || defined(WIN32) + hp_required = (size_b / hp_size) + 1; As of [1], there is the following description: "If the processor does not support large pages, the return value is zero." So there is a problem here. [1]: https://docs.microsoft.com/en-us/windows/win32/api/memoryapi/nf-memoryapi-getlargepageminimum -- Michael
Commits
-
Silence extra logging when using "postgres -C" on runtime-computed GUCs
- 8bbf8461a3a2 15.0 landed
-
doc: Improve postgres command for shared_memory_size_in_huge_pages
- bbd4951b73ec 15.0 landed
-
Introduce GUC shared_memory_size_in_huge_pages
- 43c1c4f65eab 15.0 landed
-
Support "postgres -C" with runtime-computed GUCs
- 0c39c292077e 15.0 landed
-
Make shared_memory_size a preset option
- 3b231596ccfc 15.0 landed
-
Introduce GUC shared_memory_size
- bd1788051b02 15.0 landed
-
Move the shared memory size calculation to its own function
- 0bd305ee1d42 15.0 landed
-
Add new GUC, max_worker_processes, limiting number of bgworkers.
- 6bc8ef0b7f1f 9.4.0 cited