Wednesday, March 25, 2020

Releasing TIME_WAIT connection

If you are noticing that heavy connection piling up on a port and never released. Please try this kernel tuning

# Network tunning
net.ipv4.tcp_fin_timeout = 35
net.ipv4.tcp_keepalive_time = 1800
net.ipv4.tcp_keepalive_intvl = 35
net.ipv4.tcp_tw_recycle = 1
net.ipv4.tcp_tw_reuse = 1 

[root@host1 hiuy]# netstat -atunlp | grep TIME
tcp        0      0 10.108.194.225:8443     10.119.209.8:62844      TIME_WAIT   -
tcp        0      0 10.108.194.225:8443     10.119.209.8:62735      TIME_WAIT   -
tcp        0      0 10.108.194.225:8443     10.119.209.8:62771      TIME_WAIT   -
tcp        0      0 10.108.194.225:8443     10.119.209.8:62784      TIME_WAIT   -
tcp        0      0 10.108.194.225:8443     10.119.209.8:62818      TIME_WAIT   -
tcp        0      0 10.108.194.225:8443     10.119.209.8:62833      TIME_WAIT   -