Re: "out of memory" error

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: "out of memory" error
Дата
Msg-id 18161.1187849631@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: "out of memory" error  (Christian Schröder <cs@deriva.de>)
Ответы Re: "out of memory" error
Список pgsql-general
=?UTF-8?B?Q2hyaXN0aWFuIFNjaHLDtmRlcg==?= <cs@deriva.de> writes:
> hubert depesz lubaczewski wrote:
>> On Wed, Aug 22, 2007 at 07:07:20PM +0200, Christian Schröder wrote:
>>> These are the current settings from the server configuration:
>>> shared_buffers = 3GB
>>
>> this is *way* to much. i would suggest lowering it to 1gig *at most*.
>>
> Ok, I can do this, but why can more memory be harmful?

Because you've left no room for anything else?  The kernel, the various
other daemons, the Postgres code itself, and the local memory for each
Postgres process all require more than zero space.

Even more to the point, with such a large shared-buffer space, the
kernel probably will be tempted to swap out whatever parts of it seem
less used at the moment.  That is far more harmful to performance than
not having had the buffer in the first place --- it can easily triple
the amount of disk I/O involved.  (Thought experiment: dirty buffer is
written to disk, versus dirty buffer is swapped out to disk, then later
has to be swapped in so it can be written to wherever it should have
gone.)

Bottom line is that PG shared buffers are not so important as to deserve
3/4ths of your RAM.

            regards, tom lane

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

Предыдущее
От: Christian Schröder
Дата:
Сообщение: Re: "out of memory" error
Следующее
От: "Patrick Lindeman"
Дата:
Сообщение: Re: CPU load high