1. 程式人生 > >Linux 系統優化參數總結

Linux 系統優化參數總結

cal color bucket tcp sockets rec 溢出 mem port

系統優化參數總結:

net.ipv4.tcp_syncookies = 1  
    表示開啟SYN Cookies。當出現SYN等待隊列溢出時,啟用cookies來處理,可防範少量SYN攻擊
net.ipv4.tcp_tw_reuse = 1    
    表示開啟重用。允許將TIME-WAIT sockets重新用於新的TCP連接
net.ipv4.tcp_tw_recycle = 1  
    表示開啟TCP連接中TIME-WAIT sockets的快速回收
    關閉 tcp_tw_reccycle 的時候,kernal 是不會檢查對端機器的包的時間戳的
    在多nat模式下,需要關閉該參數,不然會導致用戶無法連接或者連接超時
net.ipv4.tcp_fin_timeout 
= 30 表示如果套接字由本端要求關閉,這個參數決定了它保持在FIN-WAIT-2狀態的時間 net.core.rmem_default = 8388608 net.core.rmem_max = 16777216 net.core.wmem_default = 8388608 net.core.wmem_max = 16777216 net.ipv4.tcp_timestamps = 1 vm.overcommit_memory = 1 net.ipv4.tcp_keepalive_time = 120 net.ipv4.tcp_fin_timeout = 30 net.ipv4.tcp_max_syn_backlog
= 6553500 net.core.somaxconn = 32768 net.core.netdev_max_backlog = 262144 net.ipv4.tcp_syn_retries = 2 net.ipv4.tcp_synack_retries = 1 net.ipv4.tcp_keepalive_probes = 5 net.ipv4.tcp_keepalive_intvl = 30 net.ipv4.ip_local_port_range = 1024 65535 net.ipv4.ip_forward = 1 開啟nat轉發 net.ipv4.tcp_max_tw_buckets
= 280000 net.netfilter.nf_conntrack_max = 65535000 net.netfilter.nf_conntrack_tcp_timeout_established = 1200

Linux 系統優化參數總結