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

Поиск
Список
Период
Сортировка
От Albe Laurenz
Тема Re: How to find how much postgresql use the memory?
Дата
Msg-id D960CB61B694CF459DCFB4B0128514C202F75D5F@exadv11.host.magwien.gv.at
обсуждение исходный текст
Ответ на 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
> I wonder how to find how much postgresql memory consumption
> is (real, not allocated) ?

You could install the pg_buffercache contrib and

SELECT pg_size_pretty(
          CAST(current_setting('block_size') AS integer) * max(bufferid)
       )
FROM pg_buffercache WHERE relfilenode IS NOT NULL;

to find out how much of the shared memory in the buffer pool is
actually in use.

There is some extra shared memory that is used for other purposes,
and there is private memory of the backends (the latter could be
a significant number).

Why do you want that number?
If it is for tuning of shared_buffers, that is probably a bad way.
Even if shared_buffers is set much higher than you'd actually need
it, sooner or later all of your shared_buffers will be used, unless
your database is tiny.

Yours,
Laurenz Albe

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

Предыдущее
От: Peter Eisentraut
Дата:
Сообщение: Re: conexiones ssl
Следующее
От: Andreas Wenk
Дата:
Сообщение: Re: pg_restore: [archiver] entry ID -825110830 out of range -- perhaps a corrupt TOC