Prevent short connections from draining your dynamic TCP port

Source: Internet
Author: User

See TCP protocol
Https://en.wikipedia.org/wiki/Transmission_Control_Protocol

But time_wait is a time window, and Linux defaults to 60 seconds.
Therefore, if the TCP session is generated and closed continuously, it can cause the problem mentioned earlier.


For Linux clients, this problem can be solved by adjusting several operating system kernel parameters.

net.ipv4.tcp_syncookies=1   # 开启SYN Cookies。当出现SYN等待队列溢出时,启用cookie来处理,可防范少量的SYN攻击net.ipv4.tcp_tw_recycle=1   # 开启TCP连接中TIME-WAIT套接字的快速回收net.ipv4.tcp_tw_reuse=1 # 开启重用。允许将TIME-WAIT套接字重新用于新的TCP连接net.ipv4.tcp_timestamps=1 # 减少time_waitnet.ipv4.tcp_tw_timeout=3 # 收缩TIME_WAIT状态socket的回收时间窗口

Prevent short connections from draining your dynamic TCP port

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.