Re: How to find how much postgresql use the memory?

Поиск
Список
Период
Сортировка
От Albe Laurenz
Тема Re: How to find how much postgresql use the memory?
Дата
Msg-id D960CB61B694CF459DCFB4B0128514C202F76308@exadv11.host.magwien.gv.at
обсуждение исходный текст
Ответ на Re: How to find how much postgresql use the memory?  (Luki Rustianto <lukirus@gmail.com>)
Ответы Re: How to find how much postgresql use the memory?
Список pgsql-general
Luki Rustianto wrote:
> Ok I see. So what's the best way to find optimum value for
> various memory-related setting of postgresql ?

How much memory is there in the machine?
Are there other programs running or is the machine dedicated to the database?
Are the queries you run complicated (order / hash large amounts of data) or simple?

Maybe a rough guideline would be:
Set work_mem to the amount of memory a query will regularly need for sorting and such,
set max_connections to the maximum number of connections you need.

Then figure out how much memory you want to dedicate to the database,
subtract work_mem * max_connections from that value and set
shared_buffers to the result value.

Make sure you adjust the kernel parameters accordingly, see
http://www.postgresql.org/docs/current/static/kernel-resources.html

Tom Lane suggested in
http://archives.postgresql.org/pgsql-general/2004-02/msg00471.php
that it might be better to set shared_buffers "relatively
small" and let the filesystem cache do the buffering, so that's
another way you can go. His advice is usually good.

Yours,
Laurenz Albe

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

Предыдущее
От: "Albe Laurenz"
Дата:
Сообщение: Re: bytea size limit?
Следующее
От: "Raymond C. Rodgers"
Дата:
Сообщение: Problem with retrieving records using double precision fields