Linux Kernel: Modify TCP/IP optimization parameters

Source: Internet
Author: User

TCP/IP optimization parameters are located in the/proc/sys/NET/directory. For example, the following are the most important optimization parameters, which are followed by their meanings:

1./proc/sys/NET/CORE/rmem_max maximum TCP Data receiving buffer

2./proc/sys/NET/CORE/wmem_max maximum TCP data sending Buffer

3./proc/sys/NET/IPv4/tcp_timestamps timestamp in

Any TCP/IP optimization parameters are located in the/proc/sys/NET/directory. For example, the following are the most important optimization parameters, which are followed by their meanings:

 

 

 

1./proc/sys/NET/CORE/rmem_max-maximum TCP Data receiving buffer

2./proc/sys/NET/CORE/wmem_max-maximum TCP data sending Buffer

3./proc/sys/NET/IPv4/tcp_timestamps-the timestamp is added to the TCP Header (see RFC 1323) by 12 bytes.

4./proc/sys/NET/IPv4/tcp_sack-select a response

5./proc/sys/NET/IPv4/tcp_window_scaling-Support for larger TCP windows. If the maximum number of TCP windows exceeds 65535 (64 K), you must set this value to 1.

6. rmem_default-default Receiving Window Size

7. rmem_max-maximum size of the Receiving Window

8. wmem_default-default size of the sending window

9. wmem_max-maximum size of the sending window

 

Any content in the/proc directory is temporary, so any modifications will be lost after the system is restarted.

 

We recommend that you automatically modify the TCP/IP parameters when starting the system:

 

Add the following code to the/etc/rc. Local Document and save the document. When the system restarts, the following TCP/IP parameters are automatically modified:

 

Echo 256960>/proc/sys/NET/CORE/rmem_default

Echo 256960>/proc/sys/NET/CORE/rmem_max

Echo 256960>/proc/sys/NET/cores/wmem_default

Echo 256960>/proc/sys/NET/CORE/wmem_max

 

Echo 0>/proc/sys/NET/IPv4/tcp_timestamps

Echo 1>/proc/sys/NET/IPv4/tcp_sack

Echo 1>/proc/sys/NET/IPv4/tcp_window_scaling

 

The TCP/IP parameters are self-explanatory. The TCP window size is set to 256960 and the TCP timestamp is disabled (12 bytes are removed from the header of each packet ), supports larger TCP windows and selective responses over TCP.

 

The above value is determined based on the Internet connection and the maximum bandwidth/latency rate.

 

Note: The values in the preceding example can be used in real time, but only some parameters are included.

 

Another method: Use/etc/sysctl. conf to set the parameter to the value you configured at system startup:

 

Net. Core. rmem_default = 256960

Net. Core. rmem_max = 256960

Net. Core. wmem_default = 256960

Net. Core. wmem_max = 256960

 

Net. ipv4.tcp _ timestamps = 0

Net. ipv4.tcp _ sack = 1

Net. ipv4.tcp _ window_scaling = 1

Related Article

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.