Setting Driver or OS TCP Keepalive

SQL

PostgreSQL  tcpKeepAlive=true
MySQL     tcpKeepAlive=true
Oracle      oracle.net.keepAlive=true

 

linux

vim /etc/sysctl.conf

# detect dead connections after 70 seconds
net.ipv4.tcp_keepalive_time = 60
net.ipv4.tcp_keepalive_intvl = 5
net.ipv4.tcp_keepalive_probes = 3

sudo sysctl --system   # 重新加载,使配置生效

 

 

see 

https://github.com/brettwooldridge/HikariCP/wiki/Setting-Driver-or-OS-TCP-Keepalive

posted on 2026-05-18 10:10  lxxd  阅读(8)  评论(0)    收藏  举报

导航