tcp_tw_recycle parameter is used to quickly reclaim connections in the TIME-WAIT status. However, under certain circumstances, this parameter may cause Protection Against Wrapped Sequence Numbers (PAWS) packet loss issues, especially when network address translation (NAT) exists in the network linkage. Therefore, it is generally recommended to disable the parameter.tcp_tw_recycle and configure tcp_tw_bucket.tcp_tw_recyclesudo sysctl -w net.ipv4.tcp_tw_recycle=0
/etc/sysctl.conf file to add or modify the following line:net.ipv4.tcp_tw_recycle = 0
sudo sysctl -p
tcp_tw_buckettcp_tw_bucket parameter is used to set the number of buckets for connections in the TIME-WAIT status. Increasing this value helps the system more efficiently handle a large number of connections in the TIME-WAIT status.sudo sysctl -w net.ipv4.tcp_max_tw_buckets=4096
/etc/sysctl.conf file to add or modify the following line:net.ipv4.tcp_max_tw_buckets = 4096
sudo sysctl -p
sudo sysctl -w fs.file-max=100000
/etc/security/limits.conf file to add or modify the following lines:* soft nofile 65535* hard nofile 65535
sudo sysctl -w net.core.somaxconn=65535
sudo sysctl -w net.ipv4.tcp_max_syn_backlog=65535
sudo sysctl -w net.ipv4.tcp_fin_timeout=15
sysctl -a | grep tcp_twsysctl -a | grep file-maxsysctl -a | grep somaxconnsysctl -a | grep tcp_max_syn_backlogsysctl -a | grep tcp_fin_timeout
Was this page helpful?
You can also Contact sales or Submit a Ticket for help.
Help us improve! Rate your documentation experience in 5 mins.
Feedback