Re: Estimating HugePages Requirements?
От | Michael Paquier |
---|---|
Тема | Re: Estimating HugePages Requirements? |
Дата | |
Msg-id | YSyIz86xUwpbP+LU@paquier.xyz обсуждение исходный текст |
Ответ на | Re: Estimating HugePages Requirements? ("Bossart, Nathan" <bossartn@amazon.com>) |
Ответы |
Re: Estimating HugePages Requirements?
|
Список | pgsql-hackers |
On Sat, Aug 28, 2021 at 05:36:37AM +0000, Bossart, Nathan wrote: > Attached is a hacky attempt at adding a shared_memory_size GUC in a > way that could be used with -C. This should include the amount of > shared memory requested by extensions, too. As long as huge_page_size > is nonzero, it seems easy enough to provide the number of huge pages > needed as well. Yes, the implementation is not good. The key thing is that by wanting to support shared_memory_size with the -C switch of postgres, we need to call process_shared_preload_libraries before output_config_variable. This additionally means to call ApplyLauncherRegister() before that so as all the bgworker slots are not taken first. Going through _PG_init() also means that we'd better use ChangeToDataDir() beforehand. Attached is a WIP to show how the order of the operations could be changed, as that's easier to grasp. Even if we don't do that, having the GUC and the refactoring of CalculateShmemSize() would still be useful, as one could just query an existing instance for an estimation of huge pages for a cloned one. The GUC shared_memory_size should have GUC_NOT_IN_SAMPLE and GUC_DISALLOW_IN_FILE, with some documentation, of course. I added the flags to the GUC, not the docs. The code setting up the GUC is not good either. It would make sense to just have that in a small wrapper of ipci.c, perhaps. -- Michael
Вложения
В списке pgsql-hackers по дате отправления: