TCP/IP Settings
All TCP/IP tuning parameters are in the/proc/sys/NET/directory. For example, the following are some of 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
All contents in the/proc directory are 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 file and save the file. 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 value in the above instance can be used in practice, but it only contains some parameters.
Another method: Use/etc/sysctl. conf to set the parameter to the value you set when the system starts:
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