Linux Kernel Parameter Adjustment instructions

Source: Internet
Author: User

Linux Kernel Parameter Adjustment indicates that all TCP/IP optimization parameters are in the/proc/sys/net/directory. For example, the following are some of the most important tuning parameters, 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-supports larger TCP windows. If the maximum number of TCP windows exceeds 65535 (64KB), 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/etc/rc. local file, and then save the file. When the system restarts, the following TCP/IP parameters will be automatically modified: echo 256960>/proc/sys/net/core/rmem_defaultecho 256960>/proc/sys/net/core/rmem_maxecho 256960>/proc/sys/net/core/wmem_defaultecho 256960>/ proc/sys/net/core/wmem_maxecho 0>/proc/sys/net/ipv4/tcp_timestam1_cho 1>/proc/sys/net/ipv4/tcp_sackecho 1>/proc/sys/ net/ipv4/tcp_window_scalingtcp/ip parameters are self-explanatory, TCP window size settings It is 256960, And the TCP timestamp is disabled (12 bytes are removed from the header of each packet). It supports a larger TCP window and a selected response from 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. when the system starts, conf configures the parameter to the value you set: net. core. rmem_default = 256960net. core. rmem_max = 256960net. core. wmem_default = 256960net. core. wmem_max = 256960net. ipv4.tcp _ timestamps = 0net. ipv4.tcp _ sack = 1net. ipv4.tcp _ window_scaling = 1 Set Linux kernel parameters to configure Linux kernel parameters (two methods). After modification, you do not need to restart update:/sbin/sysctl-p; first, enable/etc/sysctl. replace the following contents with the conf file. shmall = 2097152kernel. shmmax = 2147483648kernel. shmmni = 4096kernel. Sem = 250 32000 100 FS. file-max = 65536net. ipv4.ip _ local_port_range = 1024 65000net. core. rmem_default = 262144net. core. wmem_default = 262144net. core. rmem_max = 262144net. core. wmem_max = 262144 type 2: Open the terminal cat>/etc/sysctl. conf <kernel. shmall = 2097152kernel. shmmax = 2147483648kernel. shmmni = 4096kernel. sem = 250 32000 100 FS. file-max = 65536net. ipv4.ip _ local_port_range = 1024 65000net. core. rmem_default = 262144net. core. wmem_default = 262144net. core. rmem_max = 262144net. core. wmem_max = 262144EOF here, each parameter value is briefly explained and explained. (1) shmmax: this parameter defines the maximum size (in bytes) of the shared memory segment ). The default value is 32 M. For oracle, the default value is too low and is usually set to 2G. (2) shmmni: This Kernel Parameter is used to set the maximum number of shared memory segments within the system. The default value of this parameter is 4096. Generally, no changes are required. (3) shmall: this parameter indicates the total amount of shared memory that can be used by the system at one time (in pages ). The default value is 2097152, which does not need to be modified. (4) sem: this parameter indicates the set semaphore. (5) file-max: Maximum number of file handles. The file handle setting indicates the number of files that can be opened in linux. After the kernel is modified, run the following command to make the new configuration take effect. [Root @ linux1/root] #/sbin/sysctl-p run the following command as the root user to verify your settings: /sbin/sysctl-a | grep shm/sbin/sysctl-a | grep sem/sbin/sysctl-a | grep file-max/sbin/sysctl-a | grep ip_local_port_range example: #/sbin/sysctl-a | grep shmkernel. shmmni = 4096kernel. shmall = 2097152kernel. shmmax = 2147483648kernel. shm-use-bigpages = 0 #/sbin/sysctl-a | grep semkernel. sem = 250 32000 100 128 #/sbin/sysctl-a | grep file -Maxfs. file-max = 65536 #/sbin/sysctl-a | grep ip_local_port_rangenet.4244.ip_local_port_range = 1024 65000 if the system parameter value is smaller than the preceding parameter value, edit/etc/sysctl. conf file to add or change these parameters. Run the following command to activate the changes:/sbin/sysctl-p PS: You can use the default parameter...

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.