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 1hGnz6-0001au-Mb for pgsql-general@arkaria.postgresql.org; Wed, 17 Apr 2019 17:04:32 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hGnz5-00056T-B9 for pgsql-general@arkaria.postgresql.org; Wed, 17 Apr 2019 17:04:31 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hGnz4-00052h-W4 for pgsql-general@lists.postgresql.org; Wed, 17 Apr 2019 17:04:31 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hGnz2-0001uW-Ju for pgsql-general@postgresql.org; Wed, 17 Apr 2019 17:04:30 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id x3HH4Kt5004114; Wed, 17 Apr 2019 13:04:20 -0400 From: Tom Lane To: Francisco Olarte cc: Ajay Pratap , Adrian Klaver , Postgres General Subject: Re: PostgreSQL ping/pong to client In-reply-to: References: <70c44319-1ff8-8d26-ceba-db2b20d8496d@aklaver.com> Comments: In-reply-to Francisco Olarte message dated "Wed, 17 Apr 2019 18:41:57 +0200" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <4112.1555520660.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Wed, 17 Apr 2019 13:04:20 -0400 Message-ID: <4113.1555520660@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Francisco Olarte writes: > On Wed, Apr 17, 2019 at 4:49 PM Ajay Pratap wrote: >> Correction: I meant when my java application dies postgres should break= all the connections that were associated with that peer. > And how is the server supposed to detect that without keepalives? TCP > is dessigned to survice for extended period of times without traffic, > I used that a lot in the dial up times. > And what makes you think keepalives are impactful and unrealistic? I > use them a lot, they do not impact my workloads measurably. If we tried to do something about that in the server code proper, we'd basically be reinventing TCP keepalives --- probably badly. And we couldn't do it at all without a protocol version break, because the client-side code would also need to know about it. Just use the keepalive facility. regards, tom lane