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

From: Joshua White <joshua(dot)white(at)monash(dot)edu>
To: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
Cc: Ron <ronljohnsonjr(at)gmail(dot)com>, pgsql-general <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Re: Does idle sessions will consume more cpu and ram? If yes,how to control them
Date: 2018-12-20 04:01:01
Message-ID: CAGY1NO=oYwQ2rxwHEHte9ctuMTHaCJX_b4kYVKWKL3AwyeXB-g@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Thu, 20 Dec 2018 at 14:35, Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com> wrote:

> čt 20. 12. 2018 v 2:41 odesílatel Ron <ronljohnsonjr(at)gmail(dot)com> napsal:
>
>> On 12/19/18 7:27 PM, Michael Paquier wrote:
>> [snip]
>> > 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.
>>
>> So it's best to kill connections that have been idle for a while?
>>
>
> sure - one hour idle connection is too old.
>

I'd also assess closing the connection from the client end once its task is
done - that would reduce the number of idle connections in the first place.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2018-12-20 04:45:20 Re: Does idle sessions will consume more cpu and ram? If yes,how to control them
Previous Message Pavel Stehule 2018-12-20 03:34:16 Re: Does idle sessions will consume more cpu and ram? If yes,how to control them