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
浙公网安备 33010602011771号