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 1p5mYK-0001vV-4l for pgsql-general@arkaria.postgresql.org; Thu, 15 Dec 2022 11:37:28 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1p5mYI-000415-Pj for pgsql-general@arkaria.postgresql.org; Thu, 15 Dec 2022 11:37:26 +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 1p5mYI-00040w-C3 for pgsql-general@lists.postgresql.org; Thu, 15 Dec 2022 11:37:26 +0000 Received: from mail-wm1-x32a.google.com ([2a00:1450:4864:20::32a]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1p5mYF-0008Ak-HN for pgsql-general@lists.postgresql.org; Thu, 15 Dec 2022 11:37:25 +0000 Received: by mail-wm1-x32a.google.com with SMTP id o5-20020a05600c510500b003d21f02fbaaso1458516wms.4 for ; Thu, 15 Dec 2022 03:37:23 -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:cc:to:from:subject:message-id:from:to:cc:subject :date:message-id:reply-to; bh=KwjD3oV9LE05Bwq5HdE4ZhbwiINQXKMwJc5JyC03jR0=; b=6+JwpeKB/aJiyeTCvVoJV8bXONpAp1o5ijSGzpcaF6+KPsa9l9Z9gYhzF87dZ9WMj3 FMfNK9teO8beyNYFh98PlXvUE9y3o4M7hBhkm6jF+cdtOPv/E369D6oUfFI2RtzPbGvz Bhz5ru8wg2XAlEOFVFjXuZ43Osx033al0XWdf4QlTlx5dqMbbOsWDIhxAMvbV+8507S6 MWojimjDhtK/BmkforocbeyHgWsA/aWcckvlsrIeHa3InUuX6+hUvFsgNLRwa4E/onMX Wj2lxbuaUREG8rk5qhX7SknFMwUG9u+I6gSCNco6OrnNMXExgKcsJGUrjAljs/kyjKqW XubA== 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:cc:to:from:subject:message-id:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=KwjD3oV9LE05Bwq5HdE4ZhbwiINQXKMwJc5JyC03jR0=; b=Lk3BWBfOE202R6lCJooMqEIbvqnsZBX92NI+uUKUDPs6Y7iT2CPYDg/QxVDbMg0wmy NuEXqByP+YGjvZxIAHzXAkIjYPAX5K3KZv83t+7JCtxHegnquU5jA20vSGWV5qfSSbyJ SfqiWrUt7QZh+LYVtHyT2jMfRqqukQtnOaT2rIYZ39AHvVUY8UcN157GiRKMFg5vrv91 xLeyGKS5dPXkx3tkbeQbRy2er6oX6/hXy1pk5UdB0OSDR3QbMEEEvwrbLP1cW0T4pS9T 5iqUefSwd1YyQD1VQbuGpoqwnpZlAFweECv6XBX3OaNCqrWPByYKme66diakGFn7YkMG EMYA== X-Gm-Message-State: ANoB5pmbiLZ4fg3PSIXT2mlFaLpBOqX99p2ASdaVIVP0d2RbvnH8B28b 1tLx0wcU8IhCbjyRauMPes1wYw== X-Google-Smtp-Source: AA0mqf7lfFnW2s/zFPJS4WnwW9uHdy5DWDWsEqCmU8E2ePULPmHootV5yndY1HDWUujzRcDCpjqr0g== X-Received: by 2002:a05:600c:3483:b0:3c6:e63e:23d6 with SMTP id a3-20020a05600c348300b003c6e63e23d6mr22333259wmq.5.1671104241944; Thu, 15 Dec 2022 03:37:21 -0800 (PST) Received: from localhost.localdomain ([88.116.133.170]) by smtp.gmail.com with ESMTPSA id i6-20020a05600c290600b003cf894dbc4fsm5818107wmd.25.2022.12.15.03.37.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Dec 2022 03:37:21 -0800 (PST) Message-ID: <28b6e16270ac2e2a3e0343d6faa9c5ace97f37b3.camel@cybertec.at> Subject: Re: tcp keepalives not sent during long query From: Laurenz Albe To: Willy-Bas Loos , Tom Lane Cc: pgsql-general Date: Thu, 15 Dec 2022 12:37:21 +0100 In-Reply-To: References: <2707299.1671039504@sss.pgh.pa.us> 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: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Thu, 2022-12-15 at 08:31 +0100, Willy-Bas Loos wrote: > On Wed, Dec 14, 2022 at 6:38 PM Tom Lane wrote: > > It'd be worth doing > > > > show tcp_keepalives_idle; > > Wow, you're right! It's in the postgresql.conf but it isn't set when I reload the server > A restart also doesn't do it and even doing SET tcp_keepalives_idle=120; doesn't work. > It gives me a confirmation, but then when I SHOW the value, it gives me 0. > > wbloos=# set tcp_keepalives_idle=120; > SET > wbloos=# show tcp_keepalives_idle; >  tcp_keepalives_idle > --------------------- >  0 > (1 row) One good way to debug this is SELECT setting, source, sourcefile, sourceline FROM pg_settings WHERE name = 'tcp_keepalives_idle'; That will tell you from where you get the parameter value. Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com