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 1ngtXH-00023Q-0m for pgsql-general@arkaria.postgresql.org; Tue, 19 Apr 2022 19:29:15 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1ngtXF-00087G-HL for pgsql-general@arkaria.postgresql.org; Tue, 19 Apr 2022 19:29:13 +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 1ngtXF-000877-3k for pgsql-general@lists.postgresql.org; Tue, 19 Apr 2022 19:29:13 +0000 Received: from mail-pg1-x534.google.com ([2607:f8b0:4864:20::534]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1ngtXB-0001JL-Pl for pgsql-general@postgresql.org; Tue, 19 Apr 2022 19:29:11 +0000 Received: by mail-pg1-x534.google.com with SMTP id bg9so25005552pgb.9 for ; Tue, 19 Apr 2022 12:29:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:date:mime-version:user-agent:content-language:to:from :subject; bh=7II98QbDD4WcYGjbH+1qC3ivq7sdLtYe1dD/VclWCxw=; b=cnKbT4DlOnCWRd6jksn3aC26dqFQrX7pYdARbnRat37ErgE0NcY3Dq+CK5UBqiqopE rv11ggtc//87Z0OJS9OrJZzgxxGlXaAfqFthM+D3gsWduTekU5XXTuHqaG9w93SplfBe CSM2Jkh5PHZIvtfR+5JsHKcB+LcADo8iPihFtnDbS5RmSndzghJnjhB2QSBIAbH/MDXt mPVxksql4vzsyNO/dJ7CdFq3p/j2OuMaU/Jgfu9NAzHu571pDc6WG//3o3ow0P8UQZVo sXbWiYXohTM0q09TT//7vIsLUdcjT9kCX7dEm9cZTWyNC4PZdVWeOTghR0qqN7GDPdB9 OFRg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent :content-language:to:from:subject; bh=7II98QbDD4WcYGjbH+1qC3ivq7sdLtYe1dD/VclWCxw=; b=I2fy6tzgmM4nuNx2hTEzDVrnzJWRlC2tv+aCpw2P8jNHu8+YrwfoHx9hJKBtzk17rk pL6xSUoRcfWfPna/QuLg7kcMy9K6XRgyC6Q94uAxZSHSohvaE3Z9mihBY2wy9QmP6vNd 6Ku53w2iCjuTjB8e6njd0HtJfO3OZHFopMkC6icCKmG5sIMavdW8f5Fo2r25MxaJs1/g 1sOQjUHD3+vYNTJq17AVWp+rMRuKrUTRkclbvccYtaGDI8aF1JLLEOaCI1ZY+1kqxjze GZaJUgnbta3NLvC2jtK6BLsZdJ64nWUo/65fEcrhRgD/A2VFQujfJhcrrmFgoI4KAiBA Pybw== X-Gm-Message-State: AOAM530o+qHZLEcFouz4C//PW08eKzfaH7m/pOQP5MLNj7FunaOc8Qrb 3tAqlB51AZybick2/ALNBYSFbQ7lYGs= X-Google-Smtp-Source: ABdhPJxRfagHx09Smu/Rs7BcCwKGoVGoVRfEbOWqVC6XNbNPeru7DbT2M43q/8ok8mHa7S9XMHJ9pg== X-Received: by 2002:a62:6204:0:b0:50a:ba9a:30d6 with SMTP id w4-20020a626204000000b0050aba9a30d6mr1013633pfb.73.1650396546447; Tue, 19 Apr 2022 12:29:06 -0700 (PDT) Received: from [10.128.71.194] ([155.98.131.2]) by smtp.gmail.com with ESMTPSA id cw2-20020a056a00450200b0050ab7f48a9csm874747pfb.170.2022.04.19.12.29.05 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 19 Apr 2022 12:29:05 -0700 (PDT) Content-Type: multipart/alternative; boundary="------------HDeBAOV0xPRreEr0NQ2wc3vT" Message-ID: <81a2f331-de6a-2c8e-a625-d692ccff7363@gmail.com> Date: Tue, 19 Apr 2022 13:29:04 -0600 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.7.0 Content-Language: en-CA To: "pgsql-general@postgresql.org" From: Rob Sargent Subject: psql timeout: who's waiting for whom List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk This is a multi-part message in MIME format. --------------HDeBAOV0xPRreEr0NQ2wc3vT Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit I'll be asking 'those in charge' to reset some timeout/keep-alive setting /somewhere/. I need help in hopefully naming the correct setting.  The server is running version 14 Am I dealing with a client issue, a server issue or a mis-match in host/postgres configuration values?  If I cannot have psql wait forever, I would at least like it to die/reconnect quickly.  What are my options? If I leave my psql session for long enough, then the first interaction (with some exceptions) will be unresponsive for /some time/.  The typical, eventual response is a successful re-connection though last one was fatal: barnard=# \i ~/gits/gitlab/sgs5/jooq/src/main/resources/db/scripts/functions/showSegmentCalls.sql psql:/uufs/chpc.utah.edu/common/HIPAA/u0138544/gits/gitlab/sgs5/jooq/src/main/resources/db/scripts/functions/showSegmentCalls.sql:22: SSL SYSCALL error: Connection timed out psql:/uufs/chpc.utah.edu/common/HIPAA/u0138544/gits/gitlab/sgs5/jooq/src/main/resources/db/scripts/functions/showSegmentCalls.sql:23: no connection to the server psql:/uufs/chpc.utah.edu/common/HIPAA/u0138544/gits/gitlab/sgs5/jooq/src/main/resources/db/scripts/functions/showSegmentCalls.sql:23: fatal: connection to server was lost More typically I get this barnard=# select 1;   C-c C-cCancel request sent SSL SYSCALL error: Connection timed out barnard=# \c barnard psql (12.2, server 14.2) WARNING: psql major version 12, server major version 14.          Some psql features might not work. SSL connection (protocol: TLSv1.2, cipher: ECDHE-RSA-AES128-GCM-SHA256, bits: 128, compression: off) You are now connected to database "barnard" as user "postgres". The client machine is using default TCP values, tcp_keepalive_intvl: 75 tcp_keepalive_probes: 9 tcp_keepalive_time: 7200 the dbhost postgresql.conf has tcp_* set to zero (use default) #tcp_keepalives_idle = 0                # TCP_KEEPIDLE, in seconds;                                         # 0 selects the system default #tcp_keepalives_interval = 0            # TCP_KEEPINTVL, in seconds;                                         # 0 selects the system default #tcp_keepalives_count = 0               # TCP_KEEPCNT;                                         # 0 selects the system default #tcp_user_timeout = 0                   # TCP_USER_TIMEOUT, in milliseconds;                                         # 0 selects the system default #client_connection_check_interval = 0   # time between checks for client                                         # disconnection while running queries;                                         # 0 for never [postgres@csgsdb ipv4]$ for t in tcp_keep*;do printf "%s: " $t; cat $t; done tcp_keepalive_intvl: 75 tcp_keepalive_probes: 9 tcp_keepalive_time: 7200 Thanks --------------HDeBAOV0xPRreEr0NQ2wc3vT Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit I'll be asking 'those in charge' to reset some timeout/keep-alive setting /somewhere/.  I need help in hopefully naming the correct setting.  The server is running version 14


Am I dealing with a client issue, a server issue or a mis-match in host/postgres configuration values?  If I cannot have psql wait forever, I would at least like it to die/reconnect quickly.  What are my options?

If I leave my psql session for long enough, then the first interaction (with some exceptions) will be unresponsive for /some time/.  The typical, eventual response is a successful re-connection though last one was fatal:
barnard=# \i ~/gits/gitlab/sgs5/jooq/src/main/resources/db/scripts/functions/showSegmentCalls.sql

psql:/uufs/chpc.utah.edu/common/HIPAA/u0138544/gits/gitlab/sgs5/jooq/src/main/resources/db/scripts/functions/showSegmentCalls.sql:22: SSL SYSCALL error: Connection timed out
psql:/uufs/chpc.utah.edu/common/HIPAA/u0138544/gits/gitlab/sgs5/jooq/src/main/resources/db/scripts/functions/showSegmentCalls.sql:23: no connection to the server
psql:/uufs/chpc.utah.edu/common/HIPAA/u0138544/gits/gitlab/sgs5/jooq/src/main/resources/db/scripts/functions/showSegmentCalls.sql:23: fatal: connection to server was lost
More typically I get this
barnard=# select 1;
  C-c C-cCancel request sent
SSL SYSCALL error: Connection timed out
barnard=# \c barnard
psql (12.2, server 14.2)
WARNING: psql major version 12, server major version 14.
         Some psql features might not work.
SSL connection (protocol: TLSv1.2, cipher: ECDHE-RSA-AES128-GCM-SHA256, bits: 128, compression: off)
You are now connected to database "barnard" as user "postgres".

 

The client machine is using default TCP values,
tcp_keepalive_intvl: 75
tcp_keepalive_probes: 9
tcp_keepalive_time: 7200

the dbhost postgresql.conf has tcp_* set to zero (use default)
#tcp_keepalives_idle = 0                # TCP_KEEPIDLE, in seconds;
                                        # 0 selects the system default
#tcp_keepalives_interval = 0            # TCP_KEEPINTVL, in seconds;
                                        # 0 selects the system default
#tcp_keepalives_count = 0               # TCP_KEEPCNT;
                                        # 0 selects the system default
#tcp_user_timeout = 0                   # TCP_USER_TIMEOUT, in milliseconds;
                                        # 0 selects the system default

#client_connection_check_interval = 0   # time between checks for client
                                        # disconnection while running queries;
                                        # 0 for never
[postgres@csgsdb ipv4]$ for t in tcp_keep*;do printf "%s: " $t; cat $t; done
tcp_keepalive_intvl: 75
tcp_keepalive_probes: 9
tcp_keepalive_time: 7200

Thanks



--------------HDeBAOV0xPRreEr0NQ2wc3vT--