Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jK2a7-0007Pn-9Q for pgsql-general@arkaria.postgresql.org; Thu, 02 Apr 2020 16:20:39 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jK2a6-0007w8-6D for pgsql-general@arkaria.postgresql.org; Thu, 02 Apr 2020 16:20:38 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jK2a5-0007uC-Uj for pgsql-general@lists.postgresql.org; Thu, 02 Apr 2020 16:20:37 +0000 Received: from mx-us-phx-03.bmc.com ([198.147.194.158] helo=mx-us-phx-03-int.bmc.com) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jK2Zz-0004Wj-Ct for pgsql-general@postgresql.org; Thu, 02 Apr 2020 16:20:37 +0000 Received: from pps.filterd (mx-us-phx-03-int.bmc.com [127.0.0.1]) by mx-us-phx-03-int.bmc.com (8.16.0.27/8.16.0.27) with SMTP id 032FBBrH045725; Thu, 2 Apr 2020 16:20:29 GMT Received: from phx-exmbprd-01.adprod.bmc.com (phx-exmbprd-01.adprod.bmc.com [172.24.35.196]) by mx-us-phx-03-int.bmc.com with ESMTP id 304jsywx0a-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Thu, 02 Apr 2020 16:20:29 +0000 Received: from PHX-EXMBPRD-01.adprod.bmc.com (172.24.35.196) by phx-exmbprd-01.adprod.bmc.com (172.24.35.196) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Thu, 2 Apr 2020 11:20:28 -0500 Received: from PHX-EXMBPRD-01.adprod.bmc.com ([172.24.31.226]) by phx-exmbprd-01.adprod.bmc.com ([172.24.31.226]) with mapi id 15.00.1497.000; Thu, 2 Apr 2020 11:20:28 -0500 From: "Abraham, Danny" To: Tom Lane CC: "pgsql-general@postgresql.org" Thread-Topic: [EXTERNAL] Re: too many clients already Thread-Index: AdYJACbU3d7j1EwfS6Gf573iXWACkgAMGQ6AAAmEpVA= Date: Thu, 2 Apr 2020 16:20:27 +0000 Message-ID: <92f708a939754943bb4e75b47d1a10ba@phx-exmbprd-01.adprod.bmc.com> References: <17877.1585842715@sss.pgh.pa.us> In-Reply-To: <17877.1585842715@sss.pgh.pa.us> Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [192.168.6.253] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: RE: Re: too many clients already X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.138,18.0.676 definitions=2020-04-02_06:2020-04-02,2020-04-02 signatures=0 X-Proofpoint-Spam-Reason: safe List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Well, I guess the questions is - how do I optimize PG for a stream of very = short life checks... See below: 2020-04-02 11:05:37.010 CDTLOG: connection received: host=3D10.64.72.157 p= ort=3D45799 2020-04-02 11:05:37.014 CDTLOG: connection received: host=3D10.64.72.157 p= ort=3D45814 2020-04-02 11:05:37.014 CDTLOG: connection received: host=3D10.64.72.157 p= ort=3D45813 2020-04-02 11:05:37.018 CDTFATAL: sorry, too many clients already 2020-04-02 11:05:37.015 CDTLOG: connection received: host=3D10.64.72.157 p= ort=3D45815 2020-04-02 11:05:37.015 CDTLOG: connection received: host=3D10.64.72.157 p= ort=3D45817 2020-04-02 11:05:37.015 CDTLOG: connection received: host=3D10.64.72.157 p= ort=3D45809 2020-04-02 11:05:37.015 CDTLOG: connection received: host=3D10.64.72.157 p= ort=3D45818 2020-04-02 11:05:37.016 CDTLOG: connection received: host=3D10.64.72.157 p= ort=3D45819 2020-04-02 11:05:37.021 CDTFATAL: sorry, too many clients already 2020-04-02 11:05:37.021 CDTFATAL: sorry, too many clients already 2020-04-02 11:05:37.021 CDTFATAL: sorry, too many clients already 2020-04-02 11:05:37.021 CDTFATAL: sorry, too many clients already 2020-04-02 11:05:37.021 CDTFATAL: sorry, too many clients already 2020-04-02 11:05:37.022 CDTFATAL: sorry, too many clients already 2020-04-02 11:05:37.022 CDTFATAL: sorry, too many clients already -----Original Message----- From: Tom Lane =20 Sent: Thursday, April 02, 2020 6:52 PM To: Abraham, Danny Cc: pgsql-general@postgresql.org Subject: [EXTERNAL] Re: too many clients already "Abraham, Danny" writes: > Running on a big and stressed AIX platform and receiving lots of "CDTFATA= L: sorry, too many clients already" > and transient difficulty to log in. > Happens on all PG versions (Tested 9.5,10.4,11.5) Big installation:=20 > max_connections is 1200, shared_buffers is 2GB > But .. select count(*) from pg_stat_activity is only 66. I'd be suspicious that there are a lot of clients stuck in connection start= up (likely the authentication phase); those connections aren't going to sho= w in pg_stat_activity until they finish connecting. The "ps" suggestion Adrian gave you would not show them either, because they're not = going to say "idle". Enabling log_connections and watching the postmaster log would help prove o= r disprove that theory. regards, tom lane