# 数据库连接池配置
HikariCP: 光 HikariCP (opens new window)
curl -v https://www.baidu.com
# postgresql tcp_keepalives 配置说明
PostgreSQL: Documentation: 15: 20.3. Connections and Authentication (opens new window)
# linux 默认 tcp 配置
Using TCP keepalive under Linux (opens new window)
# istio tcp_keepalives 配置说明
Istio / Destination Rule (opens new window)
# 抓包
sudo tcpdump -i lo0 dst port 54322 or src port 54322
# Tcp 测试
cyberelf/netcat-keepalive: Classic netcat with tcp keepalive switches. (opens new window)
cat /proc/sys/net/ipv4/tcp_keepalive_time
7200
cat /proc/sys/net/ipv4/tcp_keepalive_intvl
75
cat /proc/sys/net/ipv4/tcp_keepalive_probes
9
echo 30 > /proc/sys/net/ipv4/tcp_keepalive_time
echo 5 > /proc/sys/net/ipv4/tcp_keepalive_intvl
echo 2 > /proc/sys/net/ipv4/tcp_keepalive_probes
sysctl \
net.ipv4.tcp_keepalive_time \
net.ipv4.tcp_keepalive_intvl \
net.ipv4.tcp_keepalive_probes
sysctl -w \
net.ipv4.tcp_keepalive_time=30 \
net.ipv4.tcp_keepalive_intvl=5 \
net.ipv4.tcp_keepalive_probes=2
ALTER SYSTEM SET tcp_keepalives_idle=30;
ALTER SYSTEM SET tcp_keepalives_interval=5;
ALTER SYSTEM SET tcp_keepalives_count=2;
show tcp_keepalives_idle;
show tcp_keepalives_interval;
show tcp_keepalives_count;
jdbc:postgresql://postgres:123456@localhost:5432/di_application
curl https://reqbin.com/echo \
-H "Connection: keep-alive" \
-H "Keep-Alive: timeout=5, max=100"