Estimating total amount of shared memory required by postmaster

Поиск
Список
Период
Сортировка
От Alexey Klyukin
Тема Estimating total amount of shared memory required by postmaster
Дата
Msg-id 3D49C787-D047-4C95-8CC3-84307EC88A04@commandprompt.com
обсуждение исходный текст
Ответы Re: Estimating total amount of shared memory required by postmaster  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: Estimating total amount of shared memory required by postmaster  (Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>)
Список pgsql-hackers
Hello,

We've recently come across the task of estimating the size of shared memory
required for PostgreSQL to start. This comes from the problem of validating
postgresql.conf files
(http://archives.postgresql.org/pgsql-hackers/2011-03/msg01831.php), i.e.
checking that the server will be able to start with new configuration options
without actually performing the restart. Currently, I see a couple of ways
to get the estimate:

- Use the code from ipci.c to get the total size of the shared memory segment that Postmaster would be allocating with
thegiven configuration options (shared_buffers, etc.). This would require getting the actual amount of available shared
memorysomehow, which is platform dependent and might not be very reliable. The other downside is that the code would
needto be updated if the original estimates in ipci.c changes. 

- Try to actually allocate the shared memory in a way postmaster does this nowadays, if the process fails - analyze the
errorcode to check whether the failure is due to the shmmax or shmmall limits being too low. This would need to be run
asa separate process (not postmaster's child) to avoid messing with the postmaster's own shared memory, which means
thatthis would be hard to implement as a user-callable stored function. 

I'm also looking for other ideas. Any suggestions?

Thank you,
Alexey

--
Command Prompt, Inc.                              http://www.CommandPrompt.com
PostgreSQL Replication, Consulting, Custom Development, 24x7 support





В списке pgsql-hackers по дате отправления:

Предыдущее
От: Robert Haas
Дата:
Сообщение: Re: Hacking gram.y Error syntax error at or near "MERGEJOIN"
Следующее
От: Jeff Davis
Дата:
Сообщение: Re: storing TZ along timestamps