{"Entry":{"collection":"guc","key":"tcp_keepalives_interval","name":"tcp_keepalives_interval","aliases":[],"metadata":{"baseline":false,"boot_human":"Not specified","boot_val":null,"category":"Connections and Authentication / TCP Settings","category_zh":"","changed_in":["14","16","18"],"changes":[{"documentation_changed":false,"fields":{},"from":"8.0","status":"added","to":"8.1"},{"documentation_changed":true,"fields":{},"from":"8.1","status":"changed","to":"8.2"},{"documentation_changed":true,"fields":{},"from":"8.4","status":"changed","to":"9.0"},{"documentation_changed":true,"fields":{},"from":"9.1","status":"changed","to":"9.2"},{"documentation_changed":true,"fields":{},"from":"9.3","status":"changed","to":"9.4"},{"documentation_changed":true,"fields":{},"from":"9.6","status":"changed","to":"10"},{"documentation_changed":true,"fields":{},"from":"11","status":"changed","to":"12"},{"documentation_changed":false,"fields":{"category":{"from":"Client Connection Defaults / Other Defaults","to":"Connections and Authentication / Connection Settings"}},"from":"13","status":"changed","to":"14"},{"documentation_changed":true,"fields":{"category":{"from":"Connections and Authentication / Connection Settings","to":"Connections and Authentication / TCP Settings"}},"from":"15","status":"changed","to":"16"},{"documentation_changed":false,"fields":{"extra_desc":{"from":"A value of 0 uses the system default.","to":"0 means use the system default."}},"from":"17","status":"changed","to":"18"}],"content_hash":"ff493f5f0f7a8d024b7520ed9bb6406a1b4b41d9df06b651a5df4d92fdd15c3f","context":"","default_changed_in":[],"default_history":[{"from":"9.0","to":"19","value":"0 s"}],"derived_content_hash":"ec026447d2b38e2b03271379b824bd1a5b234fe26f8f740a789910f718fbb888","editorial":{"advice":{"olap":"Long analytical connections need keepalive timing shorter than intervening network idle expiry but not so aggressive that transient loss aborts healthy jobs.","oltp":"Choose tcp_keepalives_interval with the other keepalive controls so total failure-detection time fits load-balancer, failover, and retry budgets. Confirm the operating system implements the requested socket option.","small":"Use operating-system defaults unless a measured network failure mode requires an override; tune the complete idle/interval/count tuple, not tcp_keepalives_interval alone."},"mechanism":["tcp_keepalives_interval defines the interval between TCP keepalive retransmits. 0 means use the system default. After probing begins, it spaces retransmissions and combines with tcp_keepalives_count to determine total failure-detection time.","tcp_keepalives_interval is a USER-context setting. An authorized role can change it for a session, while ALTER ROLE or ALTER DATABASE can establish a default for future sessions.","The effective failure window is derived from tcp_keepalives_idle, tcp_keepalives_interval, and tcp_keepalives_count, subject to operating-system support and any shorter network-device timeout."],"pitfalls":["Changing tcp_keepalives_interval in one session and assuming role defaults, database defaults, or other pooled sessions changed with it.","Tuning one keepalive component without calculating the full idle-plus-retransmit failure window.","Assuming PostgreSQL's requested value overrides unsupported platforms or a shorter firewall and load-balancer idle policy.","Tuning the retransmit interval without considering tcp_keepalives_count and total failure-detection time."],"references":[{"title":"PostgreSQL 19 Beta 4: tcp_keepalives_interval","url":"https://www.postgresql.org/docs/19/runtime-config-connection.html#GUC-TCP-KEEPALIVES-INTERVAL"},{"title":"PostgreSQL 19 release notes","url":"https://www.postgresql.org/docs/19/release-19.html"}],"related":["tcp_keepalives_idle","tcp_keepalives_count","tcp_user_timeout","client_connection_check_interval","authentication_timeout"],"summary":"tcp_keepalives_interval is the PostgreSQL setting that defines the interval between TCP keepalive retransmits."},"enumvals":[],"first_version":"8.1","group":"Connections and Authentication","group_slug":"connection","imported_at":"2026-09-27T17:57:32.143629+08:00","intro_commit":{},"key":"tcp_keepalives_interval","last_version":"20","max_val":"","min_val":"","name":"tcp_keepalives_interval","position":408,"present_in":["8.1","8.2","8.3","8.4","9.0","9.1","9.2","9.3","9.4","9.5","9.6","10","11","12","13","14","15","16","17","18","19","20"],"repair_provenance":{"original_source_revision":"english-manuals:857599da1586921282392e1d223c2c73fe51a47c29e2fa03c401723bf2a1e723","receipt_sha256":"8240f63069f49cea03ac68754570bc909d8a77ae37a1abb45cb5457fc3d35287","repair":"wiki-repair-20261023"},"short_desc":"Specifies the amount of time after which a TCP keepalive message that has not been acknowledged by the client should be retransmitted.","short_desc_zh":"","source_rev":"wiki-repair-20261023:bc45aa3db935b5a80bdf942ce130b3577861adf6495ff054ccefc804e88bb784","unit":"","vartype":"integer"}},"Definition":{"Collection":"guc","Key":"tcp_keepalives_interval","SourceDatabase":"center","Version":"18","SourceTable":"guc","SourceKey":"tcp_keepalives_interval","SourceRevision":"wiki-repair-20261023:bc45aa3db935b5a80bdf942ce130b3577861adf6495ff054ccefc804e88bb784","Facts":{"boot_val":"0","category":"Connections and Authentication / TCP Settings","context":"user","description":"Specifies the amount of time after which a TCP keepalive message that has not been acknowledged by the client should be retransmitted. If this value is specified without units, it is taken as seconds. A value of 0 (the default) selects the operating system's default. On Windows, setting a value of 0 will set this parameter to 1 second, since Windows does not provide a way to read the system default value. This parameter is supported only on systems that support TCP_KEEPINTVL or an equivalent socket option, and on Windows; on other systems, it must be zero. In sessions connected via a Unix-domain socket, this parameter is ignored and always reads as zero.","description_zh":"指定未被客户端确认收到的 TCP keepalive 消息在多久之后应被重传。如果指定值时没有单位，则以秒为单位。值 0（默认值）表示选择操作系统默认值。在 Windows 上，将该值设为 0 会把此参数设为 1 秒，因为 Windows 不提供读取系统默认值的方法。这个参数只有在支持 TCP_KEEPINTVL 或等效套接字选项的系统以及 Windows 上才可用；在其他系统上，它必须为零。在通过 Unix 域套接字连接的会话中，这个参数会被忽略，并始终读作零。","description_zh_html":"\u003cp\u003e\n        指定未被客户端确认收到的 TCP keepalive 消息在多久之后应被重传。如果指定值时没有单位，则以秒为单位。值 \u003ccode class=\"literal\"\u003e0\u003c/code\u003e（默认值）表示选择操作系统默认值。在 Windows 上，将该值设为 \u003ccode class=\"literal\"\u003e0\u003c/code\u003e 会把此参数设为 1 秒，因为 Windows 不提供读取系统默认值的方法。这个参数只有在支持 \u003ccode class=\"symbol\"\u003eTCP_KEEPINTVL\u003c/code\u003e 或等效套接字选项的系统以及 Windows 上才可用；在其他系统上，它必须为零。在通过 Unix 域套接字连接的会话中，这个参数会被忽略，并始终读作零。\n       \u003c/p\u003e","doc":{"anchor":"GUC-TCP-KEEPALIVES-INTERVAL","file":"runtime-config-connection.html","lang":"en","sha256":"567ba928f3e4c4783f548dc8a54f1e748f02bbe163924605f2132eb5b0da440d","slug":"18"},"documented":true,"enumvals":null,"extra_desc":"0 means use the system default.","lang":"en","max_val":"2147483647","metadata_version":"18","min_val":"0","name":"tcp_keepalives_interval","short_desc":"Time between TCP keepalive retransmits.","source":"pg-settings-source-snapshot","translation_provenance":{"inputs":[{"kind":"current-pgdoc-translation","path":"/Users/vonng/pgsty/pgdoc/zh/18/html/runtime-config-connection.html","sha256":"f4e5e4debc927cfa154bbdd71f3bf2eda8130ac3acace1109fe7d45ef2a3456b"}],"kind":"same-version-pgdoc","locale":"zh-Hans","source_revision":"b1b500221dbe5437cfca004d6b04d3f6e422765d","version":"18"},"unit":"s","vartype":"integer","zh_from":"same-version-pgdoc"},"ManualEvidence":{"doc":{"anchor":"GUC-TCP-KEEPALIVES-INTERVAL","file":"runtime-config-connection.html","lang":"en","sha256":"567ba928f3e4c4783f548dc8a54f1e748f02bbe163924605f2132eb5b0da440d","slug":"18"}},"MeasuredEvidence":{"metadata_version":"18"}},"Text":{"Collection":"guc","Key":"tcp_keepalives_interval","SourceDatabase":"center","Version":"18","Locale":"en","Title":"tcp_keepalives_interval","Summary":"Specifies the amount of time after which a TCP keepalive message that has not been acknowledged by the client should be retransmitted. If this value is specified without units, it is taken as seconds. A value of 0 (the default) selects the operating system's default. On Windows, setting a value of 0 will set this parameter to 1 second, since Windows does not provide a way to read the system default value. This parameter is supported only on systems that support TCP_KEEPINTVL or an equivalent socket option, and on Windows; on other systems, it must be zero. In sessions connected via a Unix-domain socket, this parameter is ignored and always reads as zero.","BodyHTML":"\u003cp\u003eSpecifies the amount of time after which a TCP keepalive message that has not been acknowledged by the client should be retransmitted. If this value is specified without units, it is taken as seconds. A value of 0 (the default) selects the operating system\u0026#39;s default. On Windows, setting a value of 0 will set this parameter to 1 second, since Windows does not provide a way to read the system default value. This parameter is supported only on systems that support TCP_KEEPINTVL or an equivalent socket option, and on Windows; on other systems, it must be zero. In sessions connected via a Unix-domain socket, this parameter is ignored and always reads as zero.\u003c/p\u003e","SourceRevision":"wiki-repair-20261023:bc45aa3db935b5a80bdf942ce130b3577861adf6495ff054ccefc804e88bb784","ContentHash":"ee96ae741aa26ea909075399c82919191f62006e673a331ea2280c7a619ae999","Payload":{"description":"Specifies the amount of time after which a TCP keepalive message that has not been acknowledged by the client should be retransmitted. If this value is specified without units, it is taken as seconds. A value of 0 (the default) selects the operating system's default. On Windows, setting a value of 0 will set this parameter to 1 second, since Windows does not provide a way to read the system default value. This parameter is supported only on systems that support TCP_KEEPINTVL or an equivalent socket option, and on Windows; on other systems, it must be zero. In sessions connected via a Unix-domain socket, this parameter is ignored and always reads as zero."}},"RequestedLocale":"en","Fallback":false,"Versions":["10","11","12","13","14","15","16","17","18","19","20","8.1","8.2","8.3","8.4","9.0","9.1","9.2","9.3","9.4","9.5","9.6"],"Locales":["en","zh-Hans"],"Signatures":null,"Spellings":null,"SQLState":null,"Evidence":null}
