Re: SHMMAX and shared_bufffers

Поиск
Список
Период
Сортировка
От Greg Smith
Тема Re: SHMMAX and shared_bufffers
Дата
Msg-id Pine.GSO.4.64.0811111941510.23066@westnet.com
обсуждение исходный текст
Ответ на SHMMAX and shared_bufffers  ("Thom Brown" <thombrown@gmail.com>)
Ответы Re: SHMMAX and shared_bufffers  ("Thom Brown" <thombrown@gmail.com>)
Список pgsql-general
On Tue, 11 Nov 2008, Thom Brown wrote:

> I've noticed that if I set my SHMMAX to 256 * 1024 * 1024 (268435456)
> and my shared_buffers value in postgresql.conf to 256MB the server
> fails to start.  I managed to find a tipping point: 249MB seems to be
> too much and 248MB seems to be okay.

Buffers are allocated in 8K blocks.  When you use '256MB', that turns into
32768 of those.  Each buffer has a header and some other overhead such
that they actually take up 8400 bytes[1], which totals 1.025X the amount
that actually goes into the buffer pool.  There's another MB or two that
goes into other overhead, that part depends on things like
max_connections.  That overhead computation isn't even exact in the source
code![2]

At shared_buffers=248MB, just the buffer pool overhead pushes the required
amount to allocate up to 254.3MB; that just slips by with the rest of your
settings.  At 249MB, the buffer pool needs 255.3MB.  With the other
overhead added in, that just exceeds the 256MB SHMMAX and fails.

1: http://www.postgresql.org/docs/current/static/kernel-resources.html#SHARED-MEMORY-PARAMETERS
2: http://doxygen.postgresql.org/ipci_8c.html#5371eff96f6dea948021ddfc9f0f5a38

--
* Greg Smith gsmith@gregsmith.com http://www.gregsmith.com Baltimore, MD

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

Предыдущее
От: Ivan Sergio Borgonovo
Дата:
Сообщение: still gin index creation takes forever
Следующее
От: Glen Beane
Дата:
Сообщение: Re: Problem using COPY command to load data