LINUX内核参数优化

echo "root soft nofile 65535"        >>/etc/security/limits.conf
echo "root hard nofile 65535"       >>/etc/security/limits.conf
echo "* soft nofile 65535 "            >>/etc/security/limits.conf
echo "* hard nofile 65535"            >>/etc/security/limits.conf

#sysctl  -p
echo "net.ipv6.conf.all.disable_ipv6 = 1"
echo "net.ipv6.conf.default.disable_ipv6 = 1"
echo "net.ipv6.conf.lo.disable_ipv6 = 1"
echo "vm.swappiness = 0"
echo "net.ipv4.neigh.default.gc_stale_time = 120"
echo "net.ipv4.conf.all.rp_filter = 0"
echo "net.ipv4.conf.default.rp_filter = 0"
echo "net.ipv4.conf.default.arp_announce = 2"
echo "net.ipv4.conf.lo.arp_announce = 2"
echo "net.ipv4.conf.all.arp_announce = 2"
echo "net.ipv4.tcp_max_tw_buckets = 5000"
echo "net.ipv4.tcp_syncookies = 1"
echo "net.ipv4.tcp_max_syn_backlog = 1024"
echo "net.ipv4.tcp_synack_retries = 2"
echo "net.ipv4.ip_forward = 1"
 

你可能感兴趣的:(Linux运维常见问题解决)