Linux kernel parameter optimization 1. Move the VM,
swappinessSet to
0-10
2. Place the VM,
dirty_background_ratioSet to
5-10, move the VM,
dirty_ratioSet it to the
两倍To ensure that dirty data can be continuously flushed to
磁盘, avoid instant
I/OWrite, producing serious
等待
3. Optimizing the TCP protocol stack
#减少TIME_WAIT, improve TCP efficiency net.ipv4.tcp_tw_recyle=1net.ipv4.tcp_tw_reuse=1# reduce the time in the Fin-wait-2 connection state, The system can handle more connections net.ipv4.tcp_fin_timeout=2# reduce the time of TCP keepalived connection detection, so that the system can handle more connections. net.ipv4.tcp_keepalived_time=600# increase the maximum number of SYN half connections supported by the system (default 1024x768) Net.ipv4.tcp_max_syn_backlog = 16384# Reduce the number of System SYN connection retries (default 5) Net,ipv4.tcp_synack_retries = 1net.ipv4.tcp_sync_retries = # # Sends the number of SYN packets before the kernel discards the established connection Net.ipv4.ip_local_prot_range = 4500 65535# allow the system to open the port range
4. Network optimization
#优化系统套接字缓冲区
#Increase TCP Max buffer sizenet.core.rmem_max=16777216 #最大socket读buffernet. core.wmem_max=16777216 # Maximum socket Write Buffernet.core.wmem_default = 8388608 #该文件指定了接收套接字缓冲区大小的缺省值 (in bytes) Net.core.rmem_default = 8388608
#优化TCP接收/Send Buffers
# increase Linux autotuning TCP buffer limitsnet.ipv4.tcp_rmem=4096 87380 16777216net.ipv4.tcp_wmem=4096 65536 16777216net.ipv4.tcp_mem = 94500000 915000000 927000000
#优化网络设备接收队列
net.core.netdev_max_backlog=3000
5. Other Optimizations
Net.ipv4.tcp_timestamps = 0net.ipv4.tcp_max_orphans = 3276800net.ipv4.tcp_max_tw_buckets = 360000
Linux Kernel parameter optimization