Linux 内核参数修改

  sre

kernal(){

modprobe nf_conntrack
echo "modprobe nf_conntrack" >> /etc/rc.local
modprobe bridge
echo "modprobe bridge" >> /etc/rc.local

echo '

net.ipv4.tcp_fin_timeout = 30
net.ipv4.tcp_syncookies = 1
net.ipv4.tcp_tw_reuse = 1
net.ipv4.tcp_timestamps= 0
net.ipv4.tcp_tw_recycle = 1
net.ipv4.tcp_keepalive_time = 1200
net.ipv4.ip_local_port_range = 1024 65535
net.ipv4.tcp_max_syn_backlog = 16384
net.ipv4.tcp_max_tw_buckets = 100000
net.ipv4.route.gc_timeout = 100
net.ipv4.tcp_syn_retries = 2
net.ipv4.tcp_synack_retries = 1
net.ipv4.tcp_max_orphans = 327680

net.core.somaxconn = 32768
net.core.netdev_max_backlog = 32768
fs.file-max = 655350

net.nf_conntrack_max = 102400
net.netfilter.nf_conntrack_max = 102400
net.netfilter.nf_conntrack_tcp_timeout_established = 180
net.netfilter.nf_conntrack_tcp_timeout_time_wait = 120
net.netfilter.nf_conntrack_tcp_timeout_close_wait = 60
net.netfilter.nf_conntrack_tcp_timeout_fin_wait = 120

net.core.wmem_default = 8388608
net.core.rmem_default = 8388608
net.core.rmem_max = 16777216
net.core.wmem_max = 16777216

vm.swappiness=0' >>  /etc/sysctl.conf

sysctl -p
echo ''
}

LEAVE A COMMENT

Captcha Code