Re: Estimating HugePages Requirements?
Nathan Bossart <bossartn@amazon.com>
From: "Bossart, Nathan" <bossartn@amazon.com>
To: Andres Freund <andres@anarazel.de>
Cc: Mark Dilger <mark.dilger@enterprisedb.com>, Don Seiler <don@seiler.us>, "pgsql-hackers@postgresql.org" <pgsql-hackers@postgresql.org>
Date: 2021-08-11T23:23:52Z
Lists: pgsql-hackers
Attachments
- v3-0001-introduce-option-for-retreiving-shmem-size.patch (application/octet-stream) patch v3-0001
On 8/9/21, 8:43 PM, "Andres Freund" <andres@anarazel.de> wrote:
> I don't like putting this into PostmasterMain(). Either BootstrapMain()
> (specifically checker mode) or GucInfoMain() seem like better places.
I think BootstrapModeMain() makes the most sense. It fits in nicely
with the --check logic that's already there. With v3, the following
command can be used to retrieve the amount of shared memory required.
postgres --output-shmem -D dir
While testing this new option, I noticed that you can achieve similar
results today with the following command, although this one will
actually try to create the shared memory, too.
postgres --check -D dir -c log_min_messages=debug3 2> >(grep IpcMemoryCreate)
IMO the new option is still handy, but I can see the argument that it
might not be necessary.
> That seems like an ugly API to me. Why don't we split the size
> determination and shmem creation functions into two?
I did it this way in v3.
Nathan
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