Re: Does idle sessions will consume more cpu and ram? If yes,how tocontrol them

Поиск
Список
Период
Сортировка
От Michael Paquier
Тема Re: Does idle sessions will consume more cpu and ram? If yes,how tocontrol them
Дата
Msg-id 20181220012718.GI27104@paquier.xyz
обсуждение исходный текст
Ответ на Re: Does idle sessions will consume more cpu and ram? If yes,how tocontrol them  (Joshua White <joshua.white@monash.edu>)
Ответы Re: Does idle sessions will consume more cpu and ram? If yes,how tocontrol them
Список pgsql-general
On Thu, Dec 20, 2018 at 11:32:22AM +1100, Joshua White wrote:
>> In my application, the idle sessions are consuming cpu and ram. refer the
>> ps command output.
>>
>
> If you connect to the database, does select * from pg_stat_activity() show
> a lot of idle connections?

Each backend stores its own copy of the relation cache, so if you have
idle connections which have been used for other work in the past then
the memory of those caches is still around.  Idle connections also have
a CPU cost in Postgres when building snapshots for example, and their
entries need to be scanned from a wider array, but usually the relation
cache bloat is a wider problem.  This can be countered with pgbouncer as
connection pooling.
--
Michael

Вложения

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

Предыдущее
От: Joshua White
Дата:
Сообщение: Re: Does idle sessions will consume more cpu and ram? If yes,how tocontrol them
Следующее
От: Ron
Дата:
Сообщение: Re: Does idle sessions will consume more cpu and ram? If yes,how tocontrol them