作者
digoal
日期
2019-04-09
标签
PostgreSQL , libpq , tcp_user_timeout , tcp , keepalive
背景
```
Add support TCP user timeout in libpq and the backend server
author Michael Paquier michael@paquier.xyz
Sat, 6 Apr 2019 14:23:37 +0800 (15:23 +0900)
committer Michael Paquier michael@paquier.xyz
Sat, 6 Apr 2019 14:23:37 +0800 (15:23 +0900)
commit 249d64999615802752940e017ee5166e726bc7cd
tree 0e66ac1723a854999e136e0c8cb3c3c4442b589d tree | snapshot
parent 959d00e9dbe4cfcf4a63bb655ac2c29a5e579246 commit | diff
Add support TCP user timeout in libpq and the backend server
Similarly to the set of parameters for keepalive, a connection parameter
for libpq is added as well as a backend GUC, called tcp_user_timeout.
Increasing the TCP user timeout is useful to allow a connection to
survive extended periods without end-to-end connection, and decreasing
it allows application to fail faster. By default, the parameter is 0,
which makes the connection use the system default, and follows a logic
close to the keepalive parameters in its handling. When connecting
through a Unix-socket domain, the parameters have no effect.
Author: Ryohei Nagaura
Reviewed-by: Fabien Coelho, Robert Haas, Kyotaro Horiguchi, Kirk
Jamison, Mikalai Keida, Takayuki Tsunakawa, Andrei Yahorau
Discussion: https://postgr.es/m/EDA4195584F5064680D8130B1CA91C45367328@G01JPEXMBYT04
```
tcp_user_timeout (integer)
Specifies the number of milliseconds that transmitted data may remain unacknowledged before a connection is forcibly closed. A value of 0 uses the system default. This parameter is supported only on systems that support TCP_USER_TIMEOUT; on other systems, it must be zero. In sessions connected via a Unix-domain socket, this parameter is ignored and always reads as zero.
参考
https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=249d64999615802752940e017ee5166e726bc7cd
PostgreSQL 许愿链接
您的愿望将传达给PG kernel hacker、数据库厂商等, 帮助提高数据库产品质量和功能, 说不定下一个PG版本就有您提出的功能点. 针对非常好的提议,奖励限量版PG文化衫、纪念品、贴纸、PG热门书籍等,奖品丰富,快来许愿。开不开森.