Tcp
1.tcp_keepalive_time
int keepAlive = 1; Turn on the KeepAlive property. Default value: 0 (OFF)
int keepidle = 60; If there is no data interaction within 60 seconds, the probe is made. Default value: 7200 (s)
int keepinterval = 5; The detection packet is detected at a time interval of 5 seconds. Default value: (s)
int keepcount = 2; Number of probe retries. All timeouts determine that the connection is invalid. Default value: 9 (Times)
SetSockOpt (S, Sol_socket, So_keepalive, (void*) &keepalive, sizeof (KEEPALIVE));
SetSockOpt (S, Sol_tcp, Tcp_keepidle, (void*) &keepidle, sizeof (Keepidle));
SetSockOpt (S, Sol_tcp, TCP_KEEPINTVL, (void*) &keepinterval, sizeof (Keepinterval));
SetSockOpt (S, Sol_tcp, tcp_keepcnt, (void*) &keepcount, sizeof (Keepcount));
MongoDB echo >/proc/sys/net/ipv4/tcp_keepalive_time default is 7200
Tcp_keepalive_time and RST Flag in NAT environment
This article is from the "people, to have their own ideas" blog, please be sure to keep this source http://szgb2016.blog.51cto.com/340201/1854649
TCP HTTP Optimizations