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 1p5ORO-000259-SV for pgsql-general@arkaria.postgresql.org; Wed, 14 Dec 2022 09:52:42 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1p5ORN-0006Jf-DN for pgsql-general@arkaria.postgresql.org; Wed, 14 Dec 2022 09:52:41 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1p5ORM-0006JW-RJ for pgsql-general@lists.postgresql.org; Wed, 14 Dec 2022 09:52:40 +0000 Received: from mail-wr1-x429.google.com ([2a00:1450:4864:20::429]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1p5ORK-0003BH-9M for pgsql-general@lists.postgresql.org; Wed, 14 Dec 2022 09:52:39 +0000 Received: by mail-wr1-x429.google.com with SMTP id h12so18661455wrv.10 for ; Wed, 14 Dec 2022 01:52:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cybertec-at.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:mime-version:user-agent:references :in-reply-to:date:to:from:subject:message-id:from:to:cc:subject:date :message-id:reply-to; bh=OdlCorPrGXyIyadmOqNqk9FoaoHW07V5S0KCSIRiekg=; b=ZaTdrmDkFVpSmMFT5Ksf818V1J5gl+79sKtdve0ObtJQ7Fqqc9sXJRKpTUEqi6Aa2M feJg1fqbwDbw1PKlvwYbvvpz98ntqnLp71nlUCGcVRpZuoWONdjZ+YrrpSnaT5t6jwD+ horGu3Q9s07L09K1qaxcguwL3+3LyJBS2qIQEQugMh9dXs8+RRZFzuzI6fTsgeLNwFpl PGZLiiWkqQgK90WO/aa7fELZRClAEJk2EEbj7JoVKWcMCkIicYq/do5gVTzJJLurtiXD yYH4lDZGmrypz1Rw5xRK9JSPloXfOQCBotHPOAeXntVqgMfozhlfmKqh5TpVcAJMub25 /AhQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:user-agent:references :in-reply-to:date:to:from:subject:message-id:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=OdlCorPrGXyIyadmOqNqk9FoaoHW07V5S0KCSIRiekg=; b=AvDLLOy3qNJm5M2gnIY+HtxJrqrA9bdrZbgs9wuCvknwST2Vxdf96PIcQHACYLuBFk W/WuJOn5dLqVfnDvCzmdBaoU51+NXlfZVyI6VlfFhKvi6fhbFgYzBzaeDhk+1sF1CcG/ ig0A9spsqgaGUyjF9ngaf9S+Vp6yaebAw1ev59BBHpLBQcZ4vcnojEXhrBo2rHE5O/TP D4LOL5aNvrWExfc39XJ5AXtVX2IxF3GflarS1taGGaOC+/YsI0sQLgynefSY5H8YIvlA iagD6Z30Vw3oBe7tudBaaIwyFQyth7IOfTF+yeNygd57OYWYkKePLnBFJjh0s8UlmAgc +l1g== X-Gm-Message-State: ANoB5plsp1bymiLHvTt+v+qObeXYEwG4le25FYgAViCAL10MVXfr4TYW iTEpfhwYOnP+BI9yevk7QY5vqTQyun61cln8 X-Google-Smtp-Source: AA0mqf6/lAUKXGIhfLLJfNmkz1GWUmAmX0lmrfGQKTFUa4iLWQtmYD8tqyr3VU3IeUPOyWxEj330MQ== X-Received: by 2002:adf:e385:0:b0:24a:9b90:b619 with SMTP id e5-20020adfe385000000b0024a9b90b619mr15298237wrm.52.1671011556786; Wed, 14 Dec 2022 01:52:36 -0800 (PST) Received: from localhost.localdomain ([2001:871:5e:539:1b2c:c52a:475d:310c]) by smtp.gmail.com with ESMTPSA id d1-20020adffd81000000b0023662d97130sm2303544wrr.20.2022.12.14.01.52.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Dec 2022 01:52:36 -0800 (PST) Message-ID: Subject: Re: tcp keepalives not sent during long query From: Laurenz Albe To: Willy-Bas Loos , pgsql-general Date: Wed, 14 Dec 2022 10:52:35 +0100 In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.42.4 (3.42.4-2.fc35) MIME-Version: 1.0 Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Wed, 2022-12-14 at 08:55 +0100, Willy-Bas Loos wrote: > Some users of our database have a NAT firewall and keep a postgres client (e.g. pgAdmin ) > open for hours. To prevent the connection from being killed by the firewall due to inactivity, > we configured tcp_keepalives_idle = 120 so that the server sends keepalives and keeps the > connection active. (this is on debian) > > We've recently upgraded from postgres 9.3 to 13 and from debian 6 to 11. > I'm getting the complaint that since the upgrade, the connection breaks. But only when they run a long query. > > Has anything changed in postgres that might cause this? e.g. that keepalives are only sent when the session is idle? It is the operating system kernel that sends keepalives, so that should be independent of what the PostgreSQL backend is doing. Yours, Laurenz Albe