Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gZnKq-0006fA-7V for pgsql-general@arkaria.postgresql.org; Thu, 20 Dec 2018 01:41:12 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gZnKo-00056s-37 for pgsql-general@arkaria.postgresql.org; Thu, 20 Dec 2018 01:41:10 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gZnKn-00056k-LV for pgsql-general@lists.postgresql.org; Thu, 20 Dec 2018 01:41:09 +0000 Received: from mail-oi1-x22d.google.com ([2607:f8b0:4864:20::22d]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gZnKl-0003mg-90 for pgsql-general@lists.postgresql.org; Thu, 20 Dec 2018 01:41:08 +0000 Received: by mail-oi1-x22d.google.com with SMTP id x23so109594oix.3 for ; Wed, 19 Dec 2018 17:41:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-transfer-encoding:content-language; bh=IXWftmttpn8Cvr28jqix67cfiYarNOxewQDmexJpmN0=; b=M7MpxeHYjQ70mepgJgHfe2nyICFa23tsPlRrCt/SHQAwMkRId9WQ6gK0NxLg5SUVWI WcrxixRa/Z9YRKqJY0Xa9BktlnG46eA/5u7tbSqC+SZSBTxMBA6KaHYWpEpiLnSQx2A2 QVveUqR33ls57+OwIlEHsKBwCKbzvPjrRPPLyjRME+PbRbqyrUoX5704IA24/Ku0hlk2 InCDWvj2eji3YrGD874JnhqdU2kN4z4QTyOVg7u29q2yOiski6902OsWC8CysZxtByFI t/qEmwe7OnnNFuLgZAq9UKaCaHIDn4R/Z2Ry2nwxJ6M+8Od6T3Qz3nTKedtxUiCViDJP POYA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=IXWftmttpn8Cvr28jqix67cfiYarNOxewQDmexJpmN0=; b=pACEf06D7htiQZYMvicKKWIpLd/yIvFfiZNtdSKtTICVkb5JKsSFOsB+KnXiK84EFJ gz8mvr5qSYy0k3ardkL4JXYMvPis5cuJyNcCvzcOQm3i/RT+QDxyuR+Z6ZDPEegqoNvD SxzrdNfQZijgqLrZpMhBZ2fGdICvOaXFZYP9BrFXpFglo5/MPpgab/f8/09QNTx28lVU VbXiwoBABWziAwy9NxNapRp/NP5DSrJxT8i3hdVGwXRvUcMGm6x69u+pnzyusJtvuvQn A8eG40BOJFt6YF5bkZVvO6j1Q4/+ApOwGR3boUa3usAqK54KsGzV85MaYzrZWPoGcfUL iHLg== X-Gm-Message-State: AA+aEWb5ziVCYBtn3FVAPSlkBmw76LT6xl6BTlq7PQvjN28l+Z4pwTj4 TpnWFkBC4HRy8kLVxkVeWEebxb9Y X-Google-Smtp-Source: AFSGD/VAqcpEVynhMP8r5XCFcPRO7ENOuziXDalpm8IKNm/R803gxPFQFLipsShS5+nVO5DES6g45g== X-Received: by 2002:aca:ebd4:: with SMTP id j203mr772209oih.222.1545270066033; Wed, 19 Dec 2018 17:41:06 -0800 (PST) Received: from [192.168.1.10] (ip70-171-116-89.no.no.cox.net. [70.171.116.89]) by smtp.googlemail.com with ESMTPSA id m133sm9815528oib.52.2018.12.19.17.41.05 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 19 Dec 2018 17:41:05 -0800 (PST) Subject: Re: Does idle sessions will consume more cpu and ram? If yes,how to control them To: pgsql-general@lists.postgresql.org References: <20181220012718.GI27104@paquier.xyz> From: Ron Message-ID: Date: Wed, 19 Dec 2018 19:41:04 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 MIME-Version: 1.0 In-Reply-To: <20181220012718.GI27104@paquier.xyz> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk 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? -- Angular momentum makes the world go 'round.