Re: shared_buffers formula

Поиск
Список
Период
Сортировка
От Andres Freund
Тема Re: shared_buffers formula
Дата
Msg-id 20150303112622.GG2579@alap3.anarazel.de
обсуждение исходный текст
Ответ на shared_buffers formula  (Alexander Shutyaev <shutyaev@gmail.com>)
Ответы Re: shared_buffers formula  (Alexander Shutyaev <shutyaev@gmail.com>)
Список pgsql-general
On 2015-03-03 15:06:54 +0400, Alexander Shutyaev wrote:
> Recently we've been having problems with swap on our postgresql server. It
> has 125GB of RAM. We've decided to calculate it's memory consumption. To do
> this we've used the formulas from the official docs [1].

Note that I think those formulas have been removed from the docs for a
while now (9.2?).

> However there is
> one parameter that seems strange - Shared disk buffers. According to the
> formula it occupies the following space:
>
> (block_size + 208) * shared_buffers

> Our values are
>
> block_size=8192
> shared_buffers=30GB


> The block_size has the default value and shared_buffers was calculated by
> pgtune. According to the formula the product will be around 252 000 GB
> which doesn't make any sense.

The problem with your calculation is that the shared_buffers referenced
in the formula is the number of buffers - whereas when you specify it
using a size unit (like MB, GB,...) that amount of memory is divided by
the size of a page. So you're off by a factor of 8192.

Greetings,

Andres Freund

--
 Andres Freund                       http://www.2ndQuadrant.com/
 PostgreSQL Development, 24x7 Support, Training & Services


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

Предыдущее
От: Alexander Shutyaev
Дата:
Сообщение: shared_buffers formula
Следующее
От: hailong Li
Дата:
Сообщение: Re: The slave suddenly stopped with such DB log : "will not overwrite a used ItemId" and "heap_insert_redo: failed to add tuple"