Re: Need to calculate PostgreSQL memory usage

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Need to calculate PostgreSQL memory usage
Дата
Msg-id 27546.1442357003@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Need to calculate PostgreSQL memory usage  ("HEARNE, TIMOTHY S" <th1618@att.com>)
Список pgsql-admin
"HEARNE, TIMOTHY S" <th1618@att.com> writes:
> When I use the top utility, I have recently observed memory usage of up to 190 GB but I am being told by our Server
supportteam that it never uses more than about 12 GB of computational memory (including memory used by a small Oracle
instance). I have read on-line that because PostgreSQL uses shared memory that top (and pmap) tends to overstate the
actualmemory in use. 

The traditional knock on "top" is that its per-process memory numbers tend
to give you the impression that each Postgres process is separately using
the amount of memory that is in the shared memory area.  This doesn't
apply to its system-wide totals though.

> Mem:  264114472k total, 193001540k used, 71112932k free,   497484k buffers
> Swap: 16779852k total,   697304k used, 16082548k free, 179534676k cached

I do not see any reason to not believe these numbers.  However, the
important one is "cached", which is the amount of space the kernel is
using for disk files that it's read from disk and is holding onto in hopes
of possibly saving a future disk read.  You've only got about 13.4G of
memory space that is used for other purposes.  So that squares reasonably
well with the 12G number the other guys gave you.

If you want a direct indication of the size of the shared memory area,
try "ipcs -m" (I think you need to be root or the Postgres O/S user
to see Postgres' shared memory segments that way).

In any case, it's hard to see a reason why these numbers are of concern.
You've got lots of memory left, even before the fact that the kernel would
discard cached pages immediately if it needed the space for something else.

            regards, tom lane


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

Предыдущее
От: "HEARNE, TIMOTHY S"
Дата:
Сообщение: Need to calculate PostgreSQL memory usage
Следующее
От: John Scalia
Дата:
Сообщение: string not equal query, postgresql 9.4.4