Summary of some of the linux kernel parameter optimization

sysctl command is used to dynamically modify the kernel of the operating parameters, are available in the kernel parameters directory / proc / sys in.

It contains some advanced options TCP / IP stack and virtual memory system with sysctl can read the settings over five hundred system variables.

Set sysctl variable, usually a string, numeric or Boolean type (Boolean represented by 1 Yes', 0 is identified with 'No')

Here the common system variables, lined up finishing the script, easy to use.

bin # / bash!
# Author: liusingbon
# functions: optimized kernel parameters for RHEL7
CAT /usr/lib/sysctl.d/00-system.conf >> << EOF
fs.file-max = 65535    
# maximum amount of concurrent access

= 0 net.ipv4.tcp_timestamps    
# disable stamp

net.ipv4.tcp_synack_retries. 5 =    
# for remote connection request SYN, SYN + ACK kernel will send the datagram to acknowledge receipt of a connection request SYN packet. This is a so-called three-way handshake. SYN ACK number determined here + kernel before abandoning connection sent.

Net.ipv4.tcp_syn_retries. 5 =  
# represents the number of the unit initiates outwardly TCP SYN connection timeout retransmission should not be higher than 255 ; this value only for outgoing connections for incoming connections controlled by tcp_retries1.

net.ipv4.tcp_tw_recycle. 1 =  
# TIME-WAIT sockets open quickly recovered. 1 herein a schematic enabled.

Net.ipv4.tcp_tw_reuse = 1
# indicates whether the application is allowed to re-TIME-WAIT state for the new TCP connection socket. 1 schematically enabled

net.ipv4.tcp_fin_timeout = 30
# socket end which is open to the present connection, TCP retention time FIN-WAIT-2 state. The other party may be disconnected or has been connected or not to end the unpredictable process of death. The default value is 60 seconds.

1024 = 65535 net.ipv4.ip_local_port_range
# port range used to initiate a local connection, will modify this value tcp initialization

kernel.shmall = 2097152
total amount of shared memory that can be used on the system # (unit: bytes)

kernel.shmmax = 2147483648
size of the maximum allowed by the system # shared memory segment (unit: bytes)

kernel.shmmni = 4096
maximum number # shared memory segment of the entire system

kernel.sem = 641.28 thousand 5010 5010 128
# the file contains four values:
# the largest number (semmsl) 1. the same type of signal
# 2. in the most number of signal systems = semmni * semmsl (semmns)
maximum operations # 3. each contained semop system call (up to the amount of signal can be called number of times) (SEMOPM)
#. 4. the number of the maximum signal type system, a signal representative of the amount of a type identifier (SEMMNI)

net.core.wmem_default = 262144
# default settings transmitted socket buffer size (bytes)

NET = 262144 .core.wmem_max
# socket transmission maximum cache size (bytes)

net.core.rmem_default = 4194304
# set the default socket receive buffer size (bytes)

net.core.rmem_max = 4194304
# Set the maximum buffer size (bytes) socket receive

net.ipv4.tcp_window_scaling = 0
if # indicates disposed tcp / ip session variable size sliding window, 0 disables a schematic

net.ipv4.tcp_sack = 0
# indicates whether to enable selective response (selective acknowledgment), which can by answering selectively out of order received packets to improve performance, which would allow the sender to send only the missing segment;
# for wide-area network, this option should be enabled, but this will increase the CPU occupancy.

# net.ipv4.tcp_keepalive_time = 1200
# indicates that no packet after the end of the last activity within how many seconds before sending keepalive packets to keep the connection, the default 7200s, the ideal can be set to 1800s, that is, if the non normally open, after the 1800s may know by keepalive. # comment out using here.
EOF
sysctl -p

Guess you like

Origin www.cnblogs.com/liusingbon/p/11221615.html